mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-21 10:51:10 +00:00
param_argument cleanup
This commit is contained in:
parent
488859a218
commit
1b13c86cc9
1 changed files with 12 additions and 11 deletions
23
main.c
23
main.c
|
@ -86,20 +86,21 @@ int main(int argc, char **argv) {
|
|||
);
|
||||
return 0;
|
||||
}
|
||||
#define param_argument(argtype) do { \
|
||||
if (argv[1][2]) \
|
||||
items_add((argitem){util_strdup(&argv[1][2]), argtype}); \
|
||||
else { \
|
||||
++argv; --argc; \
|
||||
if (argc <= 1) \
|
||||
goto clean_params_usage; \
|
||||
items_add((argitem){util_strdup(&argv[1][0]), argtype}); \
|
||||
} \
|
||||
} while (0)
|
||||
#define param_argument(argtype) do { \
|
||||
if (argv[1][2]) \
|
||||
items_add((argitem){util_strdup(&argv[1][2]), argtype}); \
|
||||
else { \
|
||||
++argv; --argc; \
|
||||
if (argc <= 1) \
|
||||
goto clean_params_usage; \
|
||||
items_add((argitem){util_strdup(&argv[1][0]), argtype}); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
case 'c': param_argument(0); break; /* compile */
|
||||
case 'c': param_argument(0); break; /* compile */
|
||||
case 'a': param_argument(1); break; /* assemble */
|
||||
case 'i': param_argument(2); break; /* includes */
|
||||
#undef parm_argument
|
||||
default:
|
||||
if (!strncmp(&argv[1][1], "debug" , 5)) { opts_debug = true; break; }
|
||||
if (!strncmp(&argv[1][1], "memchk", 6)) { opts_memchk = true; break; }
|
||||
|
|
Loading…
Reference in a new issue