Skip to content

Commit

Permalink
unix/main: Add #if guard around -v option usage and document -i/-m opts.
Browse files Browse the repository at this point in the history
This commit modifies the usage() function to only print the -v option help
text when MICROPY_DEBUG_PRINTERS is enabled.  The -v option requires this
build option to be enabled for it to have any effect.

The usage text is also modified to show the -i and -m options, and also
show that running a command, module or file are mutually exclusive.
  • Loading branch information
dlech authored and dpgeorge committed Feb 4, 2020
1 parent c8d2f78 commit 5a63bc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ports/unix/main.c
Expand Up @@ -305,9 +305,12 @@ STATIC int do_str(const char *str) {

STATIC int usage(char **argv) {
printf(
"usage: %s [<opts>] [-X <implopt>] [-c <command>] [<filename>]\n"
"usage: %s [<opts>] [-X <implopt>] [-c <command> | -m <module> | <filename>]\n"
"Options:\n"
"-i : enable inspection via REPL after running command/module/file\n"
#if MICROPY_DEBUG_PRINTERS
"-v : verbose (trace various operations); can be multiple\n"
#endif
"-O[N] : apply bytecode optimizations of level N\n"
"\n"
"Implementation specific options (-X):\n", argv[0]
Expand Down

0 comments on commit 5a63bc5

Please sign in to comment.