There is a batch script I need to write, let's call it script.bat. And I want it to have options, let's call them option1 and option2. Just like the famous --help we see everywhere.
And I would like the 4 following lines to be 4 possible commands to launch the script, according to the user's need :
script.bat -option1 value1 -option2 value2
script.bat -option2 value2 -option1 value1
script.bat -option1 value1
script.bat -option2 value2
Now on to the script coding : I would like a neat way to handle option reading. I know about parameters readings (%0 for the program name, %1 for parameter 1 etc). But that's not very flexible since the options, as the name implies, can be optional and in any order (cf above command at line 2 of the code block).
How would you guys go about that ?
Thanks !