Issue by st1led
Tuesday Apr 09, 2013 at 09:55 GMT
Originally opened as gsscoder/commandline#76
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:
[Option('v', "verbose",
Required = false,
DefaultValue = false,
HelpText = "Prints log messages.")]
public bool Verbose { get; set; }
[Option('o', "optional-operation",
Required = false,
DefaultValue = false,
HelpText = "Performs an operation (a.k.a. \"does something\") in the code.")]
public bool PerformOperation { get; set; }
[Option('t', "time-limit",
Required = false,
DefaultValue = false,
HelpText = "Requires option -o. Specifies a time limit for the optional operation")]
public int OperationTimeLimit { get; set; }
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
Tuesday Apr 09, 2013 at 09:55 GMT
Originally opened as gsscoder/commandline#76
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
-oand-votbut not-vtor-tfor instance, since in the latter the option-tis specified without-o. Is this currently possible in CommandLine?Regards,
Stefano