:must_match only works on arrays with 1 element within commands it seems(?). If more elements then it seems like everything is ok from the matchers perspective.
App flag that will work. If file is anything but foo or bar, then I will get an argument error.
flag :f,:file, :desc => c.bold + 'Path to the data.xml file' + c.clear, :arg_name => 'file', :default_value => './data.xml', :must_match => %w{foo bar}
This doesn't work within a command:
desc 'List tags'
command :tags do |c|
c.flag :format, :desc => 'Output format', :default_value => 'table', :must_match => %w{csv table json}
c.action do |global_options,options,args|
formatter = output_formats[options[:format]]
formatter.formatTags(dataObject.tags)
end
end
:must_match only works on arrays with 1 element within commands it seems(?). If more elements then it seems like everything is ok from the matchers perspective.
App flag that will work. If file is anything but foo or bar, then I will get an argument error.
This doesn't work within a command:
Here GLI will accept any format I type.