Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made some tweaks to banner and help message #2397

Merged
merged 3 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/build_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

void PrintBox64Version()
{
printf_log(LOG_NONE, "Box64%s%s v%d.%d.%d %s built on %s %s\n",
printf_ftrace(1, "Box64%s%s v%d.%d.%d %s built on %s %s\n",
#ifdef HAVE_TRACE
" with trace",
#else
Expand Down
51 changes: 27 additions & 24 deletions src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,11 @@ void AddNewLibs(const char* list)
}

void PrintHelp() {
printf("This is Box64, the Linux x86_64 emulator with a twist.\n");
printf("\nUsage is 'box64 [options] path/to/software [args]' to launch x86_64 software.\n");
printf(" options are:\n");
printf(" '-v'|'--version' to print box64 version and quit\n");
printf(" '-h'|'--help' to print this and quit\n");
printf_ftrace(1, "This is Box64, the Linux x86_64 emulator with a twist.\n");
printf_ftrace(1, "Usage is 'box64 [options] path/to/software [args]' to launch x86_64 software.\n");
printf_ftrace(1, " options are:\n");
printf_ftrace(1, " '-v'|'--version' to print box64 version and quit\n");
printf_ftrace(1, " '-h'|'--help' to print this and quit\n");
}

static void addLibPaths(box64context_t* context)
Expand Down Expand Up @@ -915,29 +915,15 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
LoadEnvVariables();
InitializeEnvFiles();

displayMiscInfo();

hookMangoHud();
if (!BOX64ENV(nobanner)) PrintBox64Version();

char* bashpath = NULL;
{
char* p = BOX64ENV(bash);
if(p) {
if(FileIsX64ELF(p)) {
bashpath = p;
printf_log(LOG_INFO, "Using bash \"%s\"\n", bashpath);
} else {
printf_log(LOG_INFO, "The x86_64 bash \"%s\" is not an x86_64 binary.\n", p);
}
}
}

const char* prog = argv[1];
int nextarg = 1;
// check if some options are passed
while(prog && prog[0]=='-') {
if(!strcmp(prog, "-v") || !strcmp(prog, "--version")) {
PrintBox64Version();
if (BOX64ENV(nobanner)) PrintBox64Version();
exit(0);
}
if(!strcmp(prog, "-h") || !strcmp(prog, "--help")) {
Expand All @@ -956,7 +942,24 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
printf("[BOX64] Nothing to run\n");
exit(0);
}
if (!BOX64ENV(nobanner)) PrintBox64Version();

displayMiscInfo();

hookMangoHud();

char* bashpath = NULL;
{
char* p = BOX64ENV(bash);
if(p) {
if(FileIsX64ELF(p)) {
bashpath = p;
printf_log(LOG_INFO, "Using bash \"%s\"\n", bashpath);
} else {
printf_log(LOG_INFO, "The x86_64 bash \"%s\" is not an x86_64 binary.\n", p);
}
}
}

// precheck, for win-preload
const char* prog_ = strrchr(prog, '/');
if(!prog_) prog_ = prog; else ++prog_;
Expand Down Expand Up @@ -1104,8 +1107,8 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
}
}
// print PATH and LD_LIB used
PrintCollection(&my_context->box64_ld_lib, "BOX64 LIB PATH");
PrintCollection(&my_context->box64_path, "BOX64 BIN PATH");
PrintCollection(&my_context->box64_ld_lib, "Library search path");
PrintCollection(&my_context->box64_path, "Binary search path");
// lets build argc/argv stuff
printf_log(LOG_INFO, "Looking for %s\n", prog);
if(strchr(prog, '/'))
Expand Down