You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to have a subcommand that takes a file, and some extra args, and those extra args are passed down to that file for later processing. (I embed ruby & python, so I want a way to execute that ruby/python file with arguments).
What I'm looking after:
Usage: Products/os-cli11 execute_ruby_script [OPTIONS] path [arguments...]
Positionals:
path TEXT:FILE REQUIRED Path to ruby file
arguments args Arguments to pass to the ruby file
The issue is that if I pass execute_ruby_script myfile.rb arg1 arg2 it works fine, but execute_ruby_script myfile.rb -x arg2 doesn't: The following argument was not expected: -x
$ oscli11 execute_ruby_script --help
Executes a ruby file
Usage: build/oscli11 execute_ruby_script [OPTIONS] path
Positionals:
path TEXT REQUIRED Path to ruby file
Options:
-h,--help Print this help message and exit
You can use the footer to add a user specified note.
after #786 gets merged there will be a usage field that can also be user specified.
A couple other notes. One option might be to use positionals_at_end()
then assuming the *.rb get placed in a positional argument. Everything after that would be considered a positional argument and could be placed in a positional vector.
Would a feature of adding a mandatory separator --, for eg between two positionals, be of interest to the CLI11 project? app.add_separator() and it would include it in the help message + check for it?
I'm trying to have a subcommand that takes a file, and some extra args, and those extra args are passed down to that file for later processing. (I embed ruby & python, so I want a way to execute that ruby/python file with arguments).
What I'm looking after:
The issue is that if I pass
execute_ruby_script myfile.rb arg1 arg2
it works fine, butexecute_ruby_script myfile.rb -x arg2
doesn't:The following argument was not expected: -x
How can I both:
Thanks a lot for the great lib!
Original code
Original code, also available here: https://godbolt.org/z/vasGMPrrs
Click to Expand Original code
$ oscli11 execute_ruby_script myfile.rb -x arg2 The following argument was not expected: -x Run with --help for more information.
Remaining args: it works to forward, but the help doesn't mention it
https://godbolt.org/z/c13db5WvY
It works:
But the help doesn't mention it:
Click to expand remaining args version
The text was updated successfully, but these errors were encountered: