Thanks ... Now it looks like below, and works perfect:
Code:
strcpy(cmd,argv[1]); // copy to string 'short name' variable
for (i=0; cmd[i]; i++)
cmd[i] = tolower(cmd[i]); // make it all lower case
if (strcmp(cmd,"c")==0 || strcmp(cmd,"count")==0) {
printf( " mode: Count\n" );
}
else {
if (strcmp(cmd,"h")==0 || strcmp(cmd,"head")==0) {
printf(" mode: Head\n");
}
else {
if (strcmp(cmd,"s")==0 || strcmp(cmd,"stat")==0) {
printf(" mode: Stat\n");
}
else {
if (strcmp(cmd,"csv")==0) {
printf(" mode: CSV\n");
}
else {
printf(" Unknown mode: %s\n",cmd);
}
}
}
}