X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=main.c;h=e801aaff7ea7d840a658e504273c4b0b99ed2f81;hp=6132978f41d9aa9eca20492849b04e38a03f0204;hb=8d59d7029d02fef54d905f2de9babcb571f7ead2;hpb=c41ef65cc92193e9b685cc123ca9d4de9d142756 diff --git a/main.c b/main.c index 6132978..e801aaf 100644 --- a/main.c +++ b/main.c @@ -318,7 +318,7 @@ static bool options_parse(int argc, char **argv) { con_out("Possible flags:\n\n"); for (itr = 0; itr < COUNT_FLAGS; ++itr) { util_strtononcmd(opts_flag_list[itr].name, buffer, sizeof(buffer)); - con_out(" -f%s:\n%s\n\n", buffer, opts_flag_list[itr].description); + con_out(" -f%s\n", buffer); } exit(0); } @@ -339,7 +339,9 @@ static bool options_parse(int argc, char **argv) { con_out("Possible warnings:\n"); for (itr = 0; itr < COUNT_WARNINGS; ++itr) { util_strtononcmd(opts_warn_list[itr].name, buffer, sizeof(buffer)); - con_out(" -W%s:\n%s\n\n\n", buffer, opts_warn_list[itr].description); + con_out(" -W%s\n", buffer); + if (itr == WARN_DEBUG) + con_out(" Warnings included by -Wall:\n"); } exit(0); } @@ -410,7 +412,7 @@ static bool options_parse(int argc, char **argv) { con_out("Possible optimizations:\n"); for (itr = 0; itr < COUNT_OPTIMIZATIONS; ++itr) { util_strtononcmd(opts_opt_list[itr].name, buffer, sizeof(buffer)); - con_out(" -O%-20s (-O%u):\n%s\n\n", buffer, opts_opt_oflag[itr], opts_opt_list[itr].description); + con_out(" -O%-20s (-O%u)\n", buffer, opts_opt_oflag[itr]); } exit(0); } @@ -460,13 +462,7 @@ static bool options_parse(int argc, char **argv) { } /* All long options without arguments */ else if (!strcmp(argv[0]+2, "help")) { - /* TODO .. map name back .. prittery print of - * options and their associations. - */ - for (itr = 0; itr < OPTION_COUNT; itr++) { - con_out("%s\n\n", opts_options_descriptions[itr]); - } - + usage(); exit(0); } else if (!strcmp(argv[0]+2, "version")) { @@ -526,7 +522,7 @@ static bool progs_nextline(char **out, size_t *alen,FILE *src) { char *end; line = *out; - len = file_getline(&line, alen, src); + len = fs_file_getline(&line, alen, src); if (len == -1) return false; @@ -612,7 +608,7 @@ int main(int argc, char **argv) { if (OPTS_OPTION_BOOL(OPTION_PP_ONLY)) { if (opts_output_wasset) { - outfile = file_open(OPTS_OPTION_STR(OPTION_OUTPUT), "wb"); + outfile = fs_file_open(OPTS_OPTION_STR(OPTION_OUTPUT), "wb"); if (!outfile) { con_err("failed to open `%s` for writing\n", OPTS_OPTION_STR(OPTION_OUTPUT)); retval = 1; @@ -664,7 +660,7 @@ int main(int argc, char **argv) { progs_src = true; - src = file_open("progs.src", "rb"); + src = fs_file_open("progs.src", "rb"); if (!src) { con_err("failed to open `progs.src` for reading\n"); retval = 1; @@ -693,7 +689,7 @@ int main(int argc, char **argv) { } srcdone: - file_close(src); + fs_file_close(src); mem_d(line); } @@ -727,7 +723,7 @@ srcdone: } out = ftepp_get(); if (out) - file_printf(outfile, "%s", out); + fs_file_printf(outfile, "%s", out); ftepp_flush(); } else {