-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
docsREADME (or other docs) could be improvedREADME (or other docs) could be improved
Description
Version: "commander": "^10.0.1",
There are several cases I'm using the .usage() option:
-
When a command only has limited number of options, I want to display all of them in
usage, instead of[options]program .command("devices") .usage("[-l]") .option("-l", "long output", false)
-
When a command requires
--before arguments because otherwise commander parses them as optionsprogram .command("shell [args...]") .description( "run remote shell command (interactive shell if no command given). `--` is required before command name." ) .usage("[options] [-- <args...>]")
It's working in each command's individual help message, like
> node .\esm\index.js help devices
Usage: tango-cli devices [-l]
Options:
-l long output (default: false)
-h, --help display help for command
But not in the main help
> node .\esm\index.js help
Usage: tango-cli [options] [command]
Options:
-H <host> name of adb server host (default: "127.0.0.1")
-P <port> port of adb server (default: 5037)
-h, --help display help for command
Commands:
devices [options]
shell [options] [args...] run remote shell command (interactive shell if no
command given). `--` is required before command name.
help [command] display help for command
In particular the second case might confuse the users if they don't know help [command] will display a different usage.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsREADME (or other docs) could be improvedREADME (or other docs) could be improved