| 1 | #include <stdio.h> |
| 2 | #include <stdlib.h> |
| 3 | #include <string.h> |
| 4 | |
| 5 | int main(int argc, char *argv[]) { |
| 6 | if (argc < 3) { |
| 7 | fprintf(stderr, format: "ERROR: Too few arguments (count: %d).\n" , argc - 1); |
| 8 | exit(status: 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(s1: argv[1], s2: cmd_opt, n: 2)) { |
| 18 | fprintf(stderr, format: "ERROR: Missing shell command option ('%s').\n" , cmd_opt); |
| 19 | exit(status: 1); |
| 20 | } |
| 21 | |
| 22 | printf(format: "SUCCESS: %s\n" , argv[0]); |
| 23 | return 0; |
| 24 | } |
| 25 | |