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.
This commit is contained in:
David Lechner 2020-01-31 10:14:31 -06:00 committed by Damien George
parent c8d2f7838f
commit 5a63bc5a44
1 changed files with 4 additions and 1 deletions

View File

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