When a command line option that takes no arguments is followed by an argument that is not an option, the non-option
argument is taken as the value of the first switch.
Take the example of using UNIX's `wc` command to count the lines in some files: wc -l file1 file2 file3. That translates
into something like this:
Choice.options do
option :lines do
short '-l'
long '--lines'
end
end
puts Choice.choices.inspect
When run on the command line with "-l" as the argument, the choices hash includes one key `lines` with the
value true. However, if you run it with "-l file1 file2 file3" as the arguments you get a choices hash with
one key "lines" but the value "file1".
One argumentless option followed by another option is fine (both end up true) unless followed by a non-option argument. |