How to set Commander gem default command?

℡╲_俬逩灬. 提交于 2019-12-11 20:00:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!