Open epage opened 2 years ago
Comment by kristof-mattei Wednesday Oct 27, 2021 at 22:24 GMT
+ 1 on this one. This is behavior that's quite common seen when using getopts_long
. Is there a way to stop clap-rs
from parsing the the incoming args as soon as it hit something unknown? That would solve this.
Issue by naftulikay Saturday Aug 31, 2019 at 00:05 GMT Originally opened as https://github.com/clap-rs/clap/issues/1538
Rust Version
Stable
Affected Version of clap
Latest
Bug or Feature Request Summary
I am unable to write a program which accepts a variable amount of final args which include flag-like values without using a delimiter.
Expected Behavior Summary
I'd like to be able to have my variable amount of args be of any format, including flag-like options.
Actual Behavior Summary
Parsing fails.
Steps to Reproduce the issue
I have created a playground example which demonstrates the problem directly.
Sample Code or Link to Sample Code
Playground
My exact use-case is that I have a positional argument which is a path to an executable, followed by a list of arguments to pass to that executable.
Example:
Internally, I'm using
--prog-flag
to customize my application's behavior, the executable path to find the binary to execute, and the variable length of args to pass to the program as arguments.I can't seem to find a way to write the above without needing a delimiter (
--
) between executable and the argument list.