-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specifying that an Option requires another Option #76
Comments
Hi, @st1led, Can you be so kind to reformulate your question telling _what you're not able to get and than explaining what you want to get? Regards, Giacomo |
Thank you for your support, I'll try to reformulate the question in a clearer way. I would like to know if CommandLine offers some API for a behavior like the following one:
Note that in this example I defined option To achieve this behavior, I have to manually write some code in my program to check if arguments have been correctly set. Since I can't find any way to do it in CommandLine, I'm asking if such feature exists, or is planned for future versions and if not... Would it be a good idea for future CommandLine versions? To me having dependencies between arguments sounds like a pretty common scenario. Regards, |
I think that it's a good idea. I'm not sure what kind of syntax you were going for with A couple potential issues: What if the option you depend on doesn't have a long option? If an option defines both a short and long option, which do you use? |
The syntax was just an attempt to specify an array of identifiers representing the options (just Since an Option can specify either a long or a short name, there would be the need to add a new parameter (named I guess Regards, |
I'm inclined to recommend using the property name itself (e.g. |
Using the property name sounds like a brilliant idea to me. This way the Regards, |
If only delegates were allowed as arguments to an attribute... you could do so much with strong typing.
|
Is there any news about this feature? I met such problem too. |
To me it makes more sense allowing a time-limit to be set, even if the optional-operation is not set. The time limit would then just be ignored by the program. And if you want to enforce this dependency it's a trivial check to do after parsing. I don't think the increased parsing complexity is worth it to provide this functionality built in. Can we find some other program that behaves this way, with argument dependencies? |
Hi everybody, is there a way in CommandLine (I guess in a way similar to what is done with mutually exclusive properties) to specify that an option requires another option to be set? This is a short example:
In this scenario, one would want to allow command line arguments like
-o
and-vot
but not-vt
or-t
for instance, since in the latter the option-t
is specified without-o
. Is this currently possible in CommandLine?Regards,
Stefano
The text was updated successfully, but these errors were encountered: