1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 main(int argc,char * argv[])5int main(int argc, char *argv[]) { 6 if (argc < 3) { 7 fprintf(stderr, "ERROR: Too few arguments (count: %d).\n", argc - 1); 8 exit(1); 9 } 10 11 #if defined(_WIN32) || defined(_WIN64) 12 char *cmd_opt = "/C"; 13 #else 14 char *cmd_opt = "-c"; 15 #endif 16 17 if (strncmp(argv[1], cmd_opt, 2)) { 18 fprintf(stderr, "ERROR: Missing shell command option ('%s').\n", cmd_opt); 19 exit(1); 20 } 21 22 printf("SUCCESS: %s\n", argv[0]); 23 return 0; 24 } 25