How you do specify multiple arguments or parameters in Thor?

command-line-arguments, command-line-interface, ruby, thor

Solution

Yes, there is another way of doing this.

require 'thor'
class TestApp < Thor
    desc "hello NAMES", "long desc"
    def hello(*names)
        say "hello #{names.join('; ')}"
    end
end

And it can be called like this:

$ thor test_app:hello first second third
hello first; second; third

Problem

my_gem hello name1 name2 name3 give me a my_gem hello requires at least 1 argument: my_gem hello name Should I just parse them and separate the arguments with a delimeter? e.g my_gem hello name1,name2,name3,nameN In the file it would look like ``` class MyCLI < Thor desc "hello NAMES", "say hello to names" def hello(names) say "hello #{names.split(',')}" end end ``` Or is there anyway to do this?

Original source

Related problems