I'm new to this and was wondering what the options are for interpreting the
command line using a CLI program. Specifically methods for interpreting the
parameters passed to the program on the command line.
I noticed that visual studio adds the following for you when creating a new
CLI program:
void main(string[] args)
{
}
so obviously there is an array of strings to use.
1) is this the standard method or are there other options? (i know thats
probably a dumb question)
2) is the args array populated by each parameter passed to the program using
a 'space' as the delimiter?
3) any recomendations for a beginner on ways to parse a command line? for
example, here are some typical structures:
command.exe param1 param2 -easy enough, simple usage of the args array
command.exe -h param1 -z param2 -using switches with a parameter for the
specific switch.
command.exe /h param1 /z param2
command.exe /h:param1 /z:param2
how to implement these different structures? I think I prefer the second way
I listed but would also want it to be flexible enough so that the order of
the switches did not matter.
I think I'm posting too early here and I don't seem to be asking any good
specific questions. Any recomendations or links to where I could find
specific information on implementing these things would be appreciated.
thanks.