I want to make a program to be called from the command line like this:
myprogram.exe -F/-T FILE/TEXT -W FILE.WAV -P FILE.PHO -A
They are 3 parts:
- myprogram.exe
- -F OR -T and the File or text
- -W FILE -P FILE and -A (At least one, up to 3, in any order (or not, if it's complicated))
So it can be:
myprogram.exe -T "Text Text, test text" -A
or:
myprogram.exe -F FILENAME -A
or:
myprogram.exe -F FILENAME -P FILENAME -W FILENAME
etc.
-A
is one function (needs the text or the file)
-W
writes a WAV file with the info from the text/file
-P
does something similar to -W
What is the best way to handle it? Analyzing argv[x]
one by one, and deciding with if
s? Something easier?
I am new to programming and using VS2008.