Thor Executable - Ignore Task Name

后端 未结 3 1607
我在风中等你
我在风中等你 2021-02-13 19:42

The thor wiki page, Making an Exectable, shows you how to create a thor powered CLI command that looks something like this:

bash ./mythorcommand foo

<
3条回答
  •  轮回少年
    2021-02-13 20:16

    Though this does not exactly solve your problem, one alternative might be using Thor.map to invoke a command by only giving an option flag:

    map '-F' => 'foo'
    

    Now you can also pass parameters

    mythorcommand -F bar # => invokes foo("bar")
    

提交回复
热议问题