commandline
commandline copied to clipboard
AutoHelp and AutoVersion don't work when the arguments contain executable name
Environment.GetCommandLineArgs() returns arguments including the program path (but not including dotnet):
{ "/Users/usrsse2/project/CLI/bin/Debug/net6.0/CLI.dll", "--version" }
When I pass it into ParseArguments<T>, it correctly parses all options and values defined in my T, but for --help and --version returns UnknownOptionError instead of the expected HelpRequestedError and VersionRequestedError. When I pass Environment.GetCommandLineArgs().Skip(1), it works correctly.
This is probably related to #600, because --help is recognized only if it's the first option.