Now i want to display the error if the user enter other thing beside minopc.exe -regserver and minopc.exe -unregserver . But it is accepting other commands and even running the program when written like minopc.exe -a etc.
Do it with if / else clauses, so that it falls through and displays the error on completion.
1 2 3 4 5 6 7 8 9 10
if (token) {
++token;
if (/* valid command line option */) {
// process it
} elseif (/* valid command line option */) {
// process it
} else {
// display error, and give valid usage
}
}