Commit graph

4 commits

Author SHA1 Message Date
Jani Nikula
4387112de0 cli: add support for hierarchical command line option arrays
NOTMUCH_OPT_INHERIT expects a notmuch_opt_desc_t * pointer in
output_var.

The "Unrecognized option" message was moved out of parse_option() to
not be emitted twice or when parsing a non-inherited option.
2014-11-05 23:17:00 +01:00
Jani Nikula
ecc4a9a644 cli: Add support for parsing keyword-flag arguments
This allows having multiple --foo=bar --foo=baz options on the command
line, with the corresponding values OR'd together.

[Test added by Michal Sojka]
2014-11-01 08:02:21 +01:00
David Bremner
f717d2ece1 command-line-arguments.[ch]: make arrays of keyword descriptors const
It seems like it should never be necessary to modify these arrays after
initialization.
2011-12-13 00:00:44 -04:00
David Bremner
2cf7b27a0c command-line-arguments.[ch]: new argument parsing framework for notmuch.
As we noticed when Jani kindly converted things to getopt_long, much
of the work in argument parsing in notmuch is due to the the key-value
style arguments like --format=(raw|json|text).

The framework here provides positional arguments, simple switches,
and --key=value style arguments that can take a value being an integer,
a string, or one of a set of keywords.
2011-12-08 20:24:24 -04:00