-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Hi
I wanted my utility to show help if no command was executed.
This was how I monkey patched my code to solve it.
parentAction = commander.Command::action
commander.Command::action = (fn) ->
newFn = ->
fn.apply this, arguments
commander.commandExecuted = this
parentAction.apply this, [newFn]
# later after parse statement
if !commander.commandExecuted?
process.stdout.write commander.helpInformation()
Is this an acceptable solution, or is there something I'm missing in the API?
Chris
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels