commandline
commandline copied to clipboard
Value attribute, with position specified, doesn't seem to work if properties aren't defined in that order
I'm using the Value attribute, and specifying some parameters like this ...
[Verb("fetch", HelpText="Download a zip of scraped documents from each agent.")]
public class FetchScrapedOptions
{
#region Properties
[Value(0, HelpText = "Local path to destination directory for downloaded zips.")]
public string LocalDestinationPath { get; set; }
[Value(1, HelpText="Remote path to the input directory of csvs.")]
public string RemoteInputPath { get; set; }
[Value(2, HelpText="Remote path to the output directory of jsons.")]
public string RemoteOutputPath { get; set; }
#endregion
}
This code above seems to work as intended, but if you reposition the LocalDestinationPath property down below the others it no longer works as intended. The provided CLI args no longer match up to the specified Value position, yet the help text still specifies the position defined in Value. So something there isn't matching up.
[Verb("fetch", HelpText="Download a zip of scraped documents from each agent.")]
public class FetchScrapedOptions
{
#region Properties
[Value(1, HelpText="Remote path to the input directory of csvs.")]
public string RemoteInputPath { get; set; }
[Value(2, HelpText="Remote path to the output directory of jsons.")]
public string RemoteOutputPath { get; set; }
[Value(0, HelpText = "Local path to destination directory for downloaded zips.")]
public string LocalDestinationPath { get; set; }
#endregion
}
The main issue being that Value doesn't seem to actually cause the parsing of CLI args to match the specified property based on the position provided. It looks like it maps to props based on their order in the class which seems odd.
Same bug as #336.