ruby - Thor Executable - Ignore Task Name -
Thor wiki page shows you how to create a thor powered CLI command, which looks like this:
For this, you first need to pass the great task foo in the argument I used to call Default_method can run a great executable without any arguments: However, I I want to give the first argument as a variable string: This does not work because the logic of the Great Command is the first argument to be argued. Is there any way to ignore the work name and send the first argument to the default argument? If this functionality does not exist, then I think it would be very useful to add a method that will pass all command line arguments in one function / method: You should expand from Thor :: Group and call that method to start bash. / Mythorcommand foo
bash ./mythorcommand
bash. / Mythorcommand "somevalue"
< Code> class MyThorCommand & LT; Thor only_method: Default defines default (* args) args.inpsect end end MyThorCommand.start
class test & lt; Thor :: Group Dis "Act Statement" DEFT Act "WWW" & End Start
Comments
Post a Comment