Custom command name in --help?
See original GitHub issueI named my cli sd
in package.json, but here shows the wrong help message Usage: index [options] [command]
now the command name is parsed from file name, is there a way to customize it?
$ node cli/index.js -h
Usage: index [options] [command]
Commands:
serve|s launch exseed app
Options:
-h, --help output usage information
-V, --version output the version number
-e, --env <env> specify environment (development|test|production)
now the way I fix this is replacing process.argv[1] before program.parse:
process.argv[1] = 'sd';
program.parse(process.argv);
I think there should be another better way
Issue Analytics
- State:
- Created 8 years ago
- Comments:10
Top Results From Across the Web
Custom Command Name - Typer - tiangolo
Typer, build great CLIs. Easy to code. Based on Python type hints.
Read more >Custom Commands - Cypress Documentation
Cypress comes with its own API for creating custom commands and overwriting existing commands. The built in Cypress commands use the very same...
Read more >add_custom_command — CMake 3.25.1 Documentation
This defines a command to generate specified OUTPUT file(s). A target created in the same directory ( CMakeLists.txt file) that specifies any output...
Read more >Custom Commands - Garden documentation
The custom commands come up when you run garden help , which helps make your project easier ... Commands cannot have the same...
Read more >Custom commands | Nushell
def "custom command" [] { "this is a custom command with a space in the name!" } # Parameter types. When defining custom...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can use the
.name
method on your program object. Like so…Then the output would be:
Hope this helps 😀
I was trying to figure this out too. The API documentation didn’t help because it was so dated. I would update it myself (at least the name() part) if I knew how to access the source.