Skip to content

Run default code if no subcommand is used #537

Answered by c4spar
sigmaSd asked this question in Q&A
Discussion options

You must be logged in to vote

You can use the .showHelp() or .getHelp() method inside the action handler. Create a reference of your command or use this to get the current command instance.

.action(function () {
  this.showHelp();
});

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@sigmaSd
Comment options

@c4spar
Comment options

@sigmaSd
Comment options

@justinmchase
Comment options

Answer selected by sigmaSd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants