History

Update exec to use the more traditional -h flag for help along with the common Windows' -?.

arr committed 9 years ago

Commit 1af55281 parent e9e85041 file · +6 −4Browse files

Showing the changes to src/exec/main.cpp (1 of 1 file). Show all

Unified · Split

src/exec/main.cpp+6−4
@@ -231,7 +231,7 @@ void print_banner(const exec_options &options) · 230 unmodified lines
231231 void print_help()
232232 {
233233 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"
235235 " d - Enable debugger\n"
236236 " e - Break on entry\n"
237237 " m - Break on module load\n"
@@ -246,7 +246,7 @@ void print_help() · 8 unmodified lines
246246 " m - Memory allocations (noisy)\n"
247247 " q - Suppress banner and configuration\n"
248248 " t - Specify the number of system threads to use (0 < x <= 4)\n"
249− " ? - Print help\n";
249+ " h - Print help (alternative: '?')\n";
250250 }
251251
252252 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
285285 void process_arg(char* arg, std::function<char *()> next, exec_options &options)
286286 {
287287 assert(arg != nullptr && next != nullptr);
288− if (arg[0] != '-')
288+ if (arg[0] != '-' && arg[0] != '/')
289289 {
290290 for (; arg != nullptr; arg = next())
291291 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
357357 options.quiet_start = true;
358358 break;
359359
360+ case 'h':
360361 case '?':
361362 options.print_help = true;
362363 break;
@@ -386,8 +387,9 @@ int main(int argc, char* argv[]) · 23 unmodified lines
386387 {
387388 std::cerr << ae.what();
388389 if (ae.arg != nullptr)
389− std::cerr << ": " << ae.arg << std::endl;
390+ std::cerr << ": " << ae.arg << "\n" << std::endl;
390391
392+ print_help();
391393 return EXIT_FAILURE;
392394 }
393395