Browse Source

unix/main: Add #if guard around -v option usage and document -i/-m opts.

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.
pull/5606/head
David Lechner 5 years ago
committed by Damien George
parent
commit
5a63bc5a44
  1. 5
      ports/unix/main.c

5
ports/unix/main.c

@ -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]

Loading…
Cancel
Save