Showing the changes to src/exec/main.cpp (1 of 1 file). Show all
Unified · Split
| @@ -231,7 +231,7 @@ void print_banner(const exec_options &options) · 230 unmodified lines | ||
| 231 | 231 | void print_help() |
| 232 | 232 | { |
| 233 | 233 | std::cout |
| 234 | − << "Usage: disvm-exec [-d[e|m|x]*] [-l[s|S|t|T|e|g|m]*] [-t <num>] [-q] [-?] <entry module> <args>*\n" | |
| 234 | + << "Usage: disvm-exec [-d[e|m|x]*] [-l[s|S|t|T|e|g|m]*] [-t <num>] [-q] [-h] <entry module> <args>*\n" | |
| 235 | 235 | " d - Enable debugger\n" |
| 236 | 236 | " e - Break on entry\n" |
| 237 | 237 | " m - Break on module load\n" |
| @@ -246,7 +246,7 @@ void print_help() · 8 unmodified lines | ||
| 246 | 246 | " m - Memory allocations (noisy)\n" |
| 247 | 247 | " q - Suppress banner and configuration\n" |
| 248 | 248 | " t - Specify the number of system threads to use (0 < x <= 4)\n" |
| 249 | − " ? - Print help\n"; | |
| 249 | + " h - Print help (alternative: '?')\n"; | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | void log_callback(const debug::component_trace_t origin, const debug::log_level_t level, const char *msg_fmt, std::va_list args) |
| @@ -285,7 +285,7 @@ void enable_logging(debug::component_trace_t c) · 32 unmodified lines | ||
| 285 | 285 | void process_arg(char* arg, std::function<char *()> next, exec_options &options) |
| 286 | 286 | { |
| 287 | 287 | assert(arg != nullptr && next != nullptr); |
| 288 | − if (arg[0] != '-') | |
| 288 | + if (arg[0] != '-' && arg[0] != '/') | |
| 289 | 289 | { |
| 290 | 290 | for (; arg != nullptr; arg = next()) |
| 291 | 291 | options.vm_args.push_back(arg); |
| @@ -357,6 +357,7 @@ void process_arg(char* arg, std::function<char *()> next, exec_options &options) · 65 unmodified lines | ||
| 357 | 357 | options.quiet_start = true; |
| 358 | 358 | break; |
| 359 | 359 | |
| 360 | + case 'h': | |
| 360 | 361 | case '?': |
| 361 | 362 | options.print_help = true; |
| 362 | 363 | break; |
| @@ -386,8 +387,9 @@ int main(int argc, char* argv[]) · 23 unmodified lines | ||
| 386 | 387 | { |
| 387 | 388 | std::cerr << ae.what(); |
| 388 | 389 | if (ae.arg != nullptr) |
| 389 | − std::cerr << ": " << ae.arg << std::endl; | |
| 390 | + std::cerr << ": " << ae.arg << "\n" << std::endl; | |
| 390 | 391 | |
| 392 | + print_help(); | |
| 391 | 393 | return EXIT_FAILURE; |
| 392 | 394 | } |
| 393 | 395 | |