Closed rchady closed 3 years ago
The convention in a lot of UNIX apps is to place them after a double dash, like so:
> foo -o outfile.txt -i infile.txt -- -x --bar
So you'd be sending -o
and -i
flags to foo
, and -x
and --bar
would show up as arguments.
I think GLI will do this given that it's based on OptionParser.
If not, that would be the preferred way to do it and it might be easy enough to add, but give it a try first
Yeah, right now trying something like
bundle exec bin/test_command -- -y
or
bundle exec bin/test_command info -- -y
Results in:
error: Too many arguments for command
or
error: Unknown option -y
Closing in favor of #307
Question, I am writing a wrapper to another program. I want to be able to specify X,Y,Z to be switches, and then take any extras that are passed in and use them to the program being wrapped. Is there a way to grab all the flags/switches/args that are not known and use them later on?