问题
I'm using the Commander gem to write a small console utility.
I want to set a default command when user does not specify any. I found how to do through the API:
Commander::Runner.instance.default_command(:gui)
but I thought there would be a simpler and more straightforward way. I just can't find it using Internet search.
回答1:
It's right in the docs, you should find what you need here https://github.com/tj/commander#command-defaults
It should be as simple as default_command :command_name
来源:https://stackoverflow.com/questions/26486055/how-to-set-commander-gem-default-command