The code ignored the last argument provided on the command line;
It did not support the recommended '--version' and '--help' from GNU which
are often handy;
It used an unusual syntax to specify the parser, now it can also use more
usual "-parser=name" and "-parser name", the old syntax is still supported
to avoid breaking compatibility;
When a problem is found with an argument, the program stops instead of
printing an error message and continuing;
There's been updates on the exit codes in case of problem because it is an
information that could be useful for people calling the program from a
script;
Took the opportunity to provide more information in the man page and to
get it cross-checked against the program's option list during "make check".
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As reported by Milan Čermák, using this variable breaks compilation on
Solaris, because it is a hack which is not standard. To ensure portability,
we now rely on main's argv[0] which is always available.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
It makes the code easier to read to explicitly define a type for the
functions that are used for callbacks, so this patch does this for the
wmmenugen tool.
It was an opportunity to highlight some variable definitions that looked
like function prototypes, and were as such misplaced in the code, being a
source of confusion.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the string passed to 'findPositionInMenu' is not
freed, and as the function does not modify it it is not necessary to
allocate a new storage for the argument.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the indentation for a block of code could lead to
misinterpretation on when it is executed. To make code safer, re-indented
the code properly and added some blank lines for clarity.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Some header were creating variable, this is a bad practice which
is likely to not behave as expected. This creates one distinct
variable in each object file that used the header, and:
- on well behaved compiler, this ends up in a link error (see
commit 39fdb451ba for an example)
- on bad behaving compiler, this can be linked as multiple local
variable, thus having strange effects when running program
- on insouciant compiler (who said gcc?) the variables are
silently merged, hiding portability issues
* Remove assigned but not used variables (GCC 4.6)
* Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this probably need
to be tweaked on a per-implementation basis as problems arise)
Add optional interface parsers may choose to implement that, when
a directory is being scanned for files to parse, may, based on
the file name, decide whether or not said file should be parsed.
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
As far as i can tell this finishes the Wmconfig parser (all bits we are
interested in/can use are parsed and converted).
The PropList writer gained ability to properly react to and handle various
flags passed by parsers.
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>