From: Wolfgang (Blub) Bumiller Date: Tue, 18 Dec 2012 14:26:41 +0000 (+0100) Subject: Added -config to usage and manpage, added a CONFIG section in the manpage describing... X-Git-Tag: 0.1.9~57 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=52b4c9f0c10267fbba0c81336de56265ed0c6f4d;p=xonotic%2Fgmqcc.git Added -config to usage and manpage, added a CONFIG section in the manpage describing the ini file format, and added a short example to it --- diff --git a/doc/gmqcc.1 b/doc/gmqcc.1 index 4e5d516..451e8dd 100644 --- a/doc/gmqcc.1 +++ b/doc/gmqcc.1 @@ -69,6 +69,10 @@ List all possible compile flags. .B -nocolor Disables colored output .TP +.BI "-config " file +Use an ini file to read all the -O, -W and -f flag from. See the +CONFIG section about the file format. +.TP .BI "-redirout=" file Redirects standard output to a \fIfile\fR .TP @@ -283,3 +287,34 @@ soption. Normally vectors generate 4 defs, once for the vector, and once for its components with _x, _y, _z suffixes. This option prevents components from being listed. +.SH CONFIG +The configuration file is similar to regular .ini files. Comments +start with hashtags or semicolons, sections are written in square +brackets and in each section there can be arbitrary many key-value +pairs. +.sp +There are 3 sections currently: +.IR flags ", " warnings ", and " optimizations . +They contain a list of boolean values of the form `VARNAME = true` or +`VARNAME = false`. The variable names are the same as for the +corresponding -W, -f or -O flag written with only capital letters and +dashes replaced by underscores. +.sp +Here's an example: +.in +4 +.nf +# a GMQCC configuration file +[flags] + FTEPP = true + ADJUST_VECTOR_FIELDS = false + LNO = true + +[warnings] + UNUSED_VARIABLE = false + USED_UNINITIALIZED = true + +[optimizations] + PEEPHOLE = true + TAIL_RECURSION = true +.fi +.in diff --git a/main.c b/main.c index 80f242c..fca93b2 100644 --- a/main.c +++ b/main.c @@ -61,6 +61,7 @@ static int usage() { 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(" -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"