]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Added -config to usage and manpage, added a CONFIG section in the manpage describing...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 18 Dec 2012 14:26:41 +0000 (15:26 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 18 Dec 2012 14:26:41 +0000 (15:26 +0100)
doc/gmqcc.1
main.c

index 4e5d516fec7c4a37ad24affd59ca6f1e1e61d8e9..451e8ddad00e4d3ee91f5ad01e772e2741318318 100644 (file)
@@ -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 80f242c52ea08cbc26b0143d0e617cf50d7e2d68..fca93b2d87b27932258607e2848fbcac491916b2 100644 (file)
--- 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"