How to set Commander gem default command?

2019-08-26 03:00发布

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条回答
闹够了就滚
2楼-- · 2019-08-26 03:19

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

查看更多
登录 后发表回答