本文介绍了如何设置Commander的gem默认命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我使用Commander gem编写一个小控制台工具。 I'm using the Commander gem to write a small console utility. 我想在用户未指定任何内容时设置默认命令。我找到了如何通过API: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.推荐答案这是正确的文档,你应该在这里找到你需要的 https://github.com/tj/commander#command-defaults It's right in the docs, you should find what you need here https://github.com/tj/commander#command-defaults它应该简单到 default_command:command_name 这篇关于如何设置Commander的gem默认命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-25 08:16