Commit graph

4 commits

Author SHA1 Message Date
Mark Walters
779ce3e930 cli: command line parsing: allow default for keyword options
This changes the parsing for "keyword" options so that if the option
is specified with no argument the argument is parsed as if it were
passed an empty string. This make it easier to add options to existing
boolean arguments (the existing --option can default to TRUE).
2012-06-29 22:31:40 -03:00
Mark Walters
b3e4417897 cli: Parsing. Allow true/false parameter for boolean options.
Allow NOTMUCH_OPT_BOOLEAN to take a true or false parameter.  In
particular it allows the user to turn off a boolean option with
--option=false.
2012-03-18 09:14:22 -03: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