diff --git a/engine/qclib/qccmain.c b/engine/qclib/qccmain.c index 9bea53826..079f89344 100644 --- a/engine/qclib/qccmain.c +++ b/engine/qclib/qccmain.c @@ -4645,8 +4645,6 @@ static void QCC_PR_CommandLinePrecompilerOptions (void) keyword_double = keyword_long = keyword_short = keyword_char = keyword_signed = keyword_unsigned = true; keyword_thinktime = keyword_until = keyword_loop = false; - keyword_integer = true; - opt_logicops = true; //early out like C. flag_assumevar = true; //const only if explicitly const. pr_subscopedlocals = true; //locals shadow other locals rather than being the same one. @@ -4974,6 +4972,8 @@ static void QCC_PR_CommandLinePrecompilerOptions (void) externs->Printf("%s\n", QCC_VersionString()); exit(EXIT_SUCCESS); } + else if ( !strcmp(myargv[i], "--help") || !strcmp(myargv[i], "-help") ) + ; //hacks... checked later. *sigh* else if (*myargv[i] == '-' || WINDOWSARG(*myargv[i] == '/')) QCC_PR_Warning(WARN_BADPARAMS, "cmdline", 0, "Unrecognised parameter (%s)", myargv[i]); else @@ -5508,24 +5508,34 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string)); if ( QCC_CheckParm ("/?") || QCC_CheckParm ("?") || QCC_CheckParm ("-?") || QCC_CheckParm ("-help") || QCC_CheckParm ("--help")) { - externs->Printf ("qcc looks for progs.src in the current directory.\n"); - externs->Printf ("to look in a different directory: qcc -src \n"); + externs->Printf ("Compile args:\n"); // externs->Printf ("to build a clean data tree: qcc -copy \n"); // externs->Printf ("to build a clean pak file: qcc -pak \n"); // externs->Printf ("to bsp all bmodels: qcc -bspmodels \n"); - externs->Printf ("-Fwasm causes FTEQCC to dump all asm to qc.asm\n"); - externs->Printf ("-O0 to disable optimisations\n"); - externs->Printf ("-O1 to optimise for size\n"); - externs->Printf ("-O2 to optimise more - some behaviours may change\n"); - externs->Printf ("-O3 to optimise lots - experimental or non-future-proof\n"); - externs->Printf ("-Oname to enable an optimisation\n"); - externs->Printf ("-Ono-name to disable optimisations\n"); - externs->Printf ("-Kkeyword to activate keyword\n"); - externs->Printf ("-Kno-keyword to disable keyword\n"); - externs->Printf ("-Wall to give a stupid number of warnings\n"); - externs->Printf ("-Ttarget to set a output format\n"); - externs->Printf ("-Fautoproto to enable automatic prototyping\n"); - externs->Printf ("-Fsubscope to make locals specific to their subscope\n"); + externs->Printf (" -src : look for the progs.src and qc files in a different directory\n"); + externs->Printf (" -srcfile : explicit path for your starting .src file\n"); + externs->Printf (" -O0 : disable optimisations\n"); + externs->Printf (" -O1 : optimise for size\n"); + externs->Printf (" -O2 : optimise more - some behaviours may change\n"); + externs->Printf (" -O3 : optimise lots - experimental or non-future-proof\n"); + externs->Printf (" -O : enable an optimisation\n"); + externs->Printf (" -Ono- : disable optimisations\n"); + externs->Printf (" -K[no-] : activate or deactivate a keyword\n"); + externs->Printf (" note that inactive keywords can still be used via __keyword\n"); + externs->Printf (" -Wall : give a stupid number of warnings\n"); + externs->Printf (" -T : set an output format\n"); + externs->Printf (" q1, h2, qtest, fte_5768, dp, kk7\n"); + externs->Printf (" -F[no-] : Enable or disable some flagged setting\n"); + externs->Printf (" wasm : causes FTEQCC to dump all asm to qc.asm\n"); + externs->Printf (" autoproto : enable automatic prototyping\n"); + externs->Printf (" subscope : make locals specific to their subscope\n"); + externs->Printf (" assumeint : don't force immediates to floats, preserving precision\n"); + externs->Printf (" dumpautocvars : write a .cfg containing all autocvars, to be inserted into your mod's default.cfg file\n"); + externs->Printf (" dumplocalisation : write a localisation template file\n"); + externs->Printf (" -D= : define a preprocessor macro via the commandline\n"); + externs->Printf (" -I : specify an alternative path to search for includes\n"); + externs->Printf (" -std= : change default settings to be more accepting of code for other compilers\n"); + externs->Printf (" qcc(vanilla), hcc(hexen2), C, qccx, reacc(for nehahra)\n"); qcc_compileactive = false; return true; diff --git a/engine/qclib/qcctui.c b/engine/qclib/qcctui.c index 6bc852447..b98ec3256 100644 --- a/engine/qclib/qcctui.c +++ b/engine/qclib/qcctui.c @@ -296,6 +296,7 @@ int main (int argc, const char **argv) #else pbool writelog = false; //other systems are sane. #endif + pbool halp = false; int colours = 2; //auto int ziparg = -1; progexterns_t ext; @@ -318,6 +319,8 @@ int main (int argc, const char **argv) writelog = true; else if (!strcmp(argv[i], "-nolog")) writelog = false; + else if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "--help")) + halp = true; //arg consistency with ls else if (!strcmp(argv[i], "--color=always") || !strcmp(argv[i], "--color")) @@ -359,7 +362,22 @@ int main (int argc, const char **argv) (void)colours; #endif - if (ziparg >= 0) + if (halp) + { + logprintf("Archiving args:\n"); + logprintf(" -l PACKAGE : List files within a pak or pk3\n"); + logprintf(" -x PACKAGE [FILENAMES]: Extract files from pak or pk3\n"); + logprintf(" -p PACKAGE FILENAME: Pipe files from a pak or pk3 to the stdout\n"); + logprintf(" -z DIRECTORY : Create a spanned pk3 from a 'foo.pk3dir' subdir.\n"); + logprintf(" the pk3 itself contains just the file table, actual data will reside in external .p## files which will NOT be overwritten and can be referenced by future revisions to reduce redundancy on future updates\n"); + logprintf(" -0 DIRECTORY : Create a hybrid pak (uncompressed)\n"); + logprintf(" such pak files can also be read with any zip tool without needing special tools to extract (but should not be edited)\n"); + logprintf(" -9 DIRECTORY : Create a standard pk3\n"); + logprintf(" regular compressed zip with limited feature set for greater engine compat\n"); + logprintf("Decompiling args:\n"); + logprintf(" -d FILENAME : decompile a progs (into working directory)\n"); + } + else if (ziparg >= 0) { if (ziparg+1 >= argc) { @@ -447,9 +465,9 @@ int main (int argc, const char **argv) { //exe -0 foo.pk3dir enum pkgtype_e t; - if (argv[1][1] == '9') + if (argv[ziparg][1] == '9') t = PACKAGER_PK3; - else if (argv[1][1] == '0') + else if (argv[ziparg][1] == '0') t = PACKAGER_PAK; //not really any difference but oh well else t = PACKAGER_PK3_SPANNED;