Skip to content
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 default executable (subcommand) option #415

Merged
merged 1 commit into from
Jun 23, 2015

Conversation

Qix-
Copy link
Contributor

@Qix- Qix- commented Jun 21, 2015

This PR introduces an option for the .command() call that allows git-style subcommands to default to a specific command in the event one isn't provided on the command line.

The use case that brought about this PR was a build system I'm developing needing to run the subcommand build automatically when nothing was specified on the command line. I'm sure there is a hack that could have done this with .action() but alas I wanted it to work with the executable functionality (i.e. having another script to do run the command).

I'm sure I'm not the only one who can find a use case for this.

Test is included (based off of the pm-subcommand test) and shouldn't interfere with the existing test.

Also added some documentation (including documentation for the previously undocumented opts.noHelp option).

I tried to keep the implementation as minimal as possible. Let me know if I need to change anything.

@noamokman
Copy link

👍

@SomeKittens
Copy link
Collaborator

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants