Closed roberts1000 closed 5 years ago
I'm afraid that's the way the feature is designed to work. I'm not sure if it's a good idea to change that as it could break the way people expect it to work. I'm open to being convinced, though. 😄
Thanks for confirming. Could we potentially have default_command
take an optional argument that can change the behavior?
default_command :foo, strict: true
Then the old behavior can continue to work as-is, but people can opt-in to the new behavior if they want it.
Yeah, something like that sounds reasonable. Would you like to take a stab at implementing that and make a pull request?
Sounds good. I'll take a look as soon as I can. Thanks for considering the enhancement.
If I use
default_command
, any time someone runs an unknown command, Commander executes the default command. Is there any way to make Commander operate similar to bundler, and have it throw an error in this situation? I only want it run the default command when no sub command is specified.