lecode-official / command-line-parser

A simple and light-weight parser for command line arguments, which makes it possible to access parameters from the command line via well-defined .NET data structures.
MIT License
3 stars 4 forks source link

Add the name of the program as the command name for the top-level ParsingResults #5

Open lecode-official opened 6 years ago

lecode-official commented 6 years ago

When having command line parameters as follows:

test value01 value02 --flag --argument01 value03 --argument02 value04

then test should be set as the command name in the top-level ParsingResults as it is the equivalent to a command. When the program contains a file extension and/or a path, then the path should be stripped from the command name, e.g.

C:\Program Files\test.exe value01 value02 /flag /argument01 value03 /argument02 value04

should result in test.exe being the command name.

Right now the program file name and path are just discarded during the parsing, which is not good, considering that, when help pages are implemented, the program file name is important, as it is needed to display the usage of the program.