-static bool options_setflag_all(const char *name, bool on, uint32_t *flags, const opts_flag_def *list, size_t listsize) {
- size_t i;
-
- for (i = 0; i < listsize; ++i) {
- if (!strcmp(name, list[i].name)) {
- longbit lb = list[i].bit;
-#if 0
- if (on)
- flags[lb.idx] |= (1<<(lb.bit));
- else
- flags[lb.idx] &= ~(1<<(lb.bit));
-#else
- if (on)
- flags[0] |= (1<<lb);
- else
- flags[0] &= ~(1<<(lb));
-#endif
- return true;
- }
- }
- return false;
-}
-static bool options_setflag(const char *name, bool on) {
- return options_setflag_all(name, on, opts_flags, opts_flag_list, COUNT_FLAGS);
-}
-static bool options_setwarn(const char *name, bool on) {
- return options_setflag_all(name, on, opts_warn, opts_warn_list, COUNT_WARNINGS);
+static int usage() {
+ con_out("usage: %s [options] [files...]", app_name);
+ con_out("options:\n"
+ " -h, --help show this help message\n"
+ " -debug turns on compiler debug messages\n"
+ " -memchk turns on compiler memory leak check\n");
+ con_out(" -o, --output=file output file, defaults to progs.dat\n"
+ " -s filename add a progs.src file to be used\n");
+ con_out(" -E stop after preprocessing\n");
+ con_out(" -q, --quiet be less verbose\n");
+ con_out(" -config file use the specified ini file\n");
+ con_out(" -std=standard select one of the following standards\n"
+ " -std=qcc original QuakeC\n"
+ " -std=fteqcc fteqcc QuakeC\n"
+ " -std=gmqcc this compiler (default)\n");
+ con_out(" -f<flag> enable a flag\n"
+ " -fno-<flag> disable a flag\n"
+ " -fhelp list possible flags\n");
+ con_out(" -W<warning> enable a warning\n"
+ " -Wno-<warning> disable a warning\n"
+ " -Wall enable all warnings\n");
+ con_out(" -Werror treat warnings as errors\n"
+ " -Werror-<warning> treat a warning as error\n"
+ " -Wno-error-<warning> opposite of the above\n");
+ con_out(" -Whelp list possible warnings\n");
+ con_out(" -O<number> optimization level\n"
+ " -O<name> enable specific optimization\n"
+ " -Ono-<name> disable specific optimization\n"
+ " -Ohelp list optimizations\n");
+ con_out(" -force-crc=num force a specific checksum into the header\n");
+ return -1;