-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parent command as prefix of subcommand #980
Changes from all commits
2365feb
b937dd4
23ddb56
cd6e608
5eefd9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var program = require('../') | ||
, should = require('should'); | ||
|
||
program | ||
.name('test') | ||
.command('info [options]') | ||
|
||
program.commands[0].helpInformation().should.startWith('Usage: test info [options]') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice to have a nested command test too, if that's explicitly being handled. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nested commands are not currently supported! But since the code included a loop, I thought it should do it right for the possible future. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit, you can shorten this by having the loop above mutate
cmdName
instead of , since it's not used below.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I did wonder about that too, but went for long and clear.