summaryrefslogtreecommitdiff
path: root/command-line-arguments.c
AgeCommit message (Collapse)Author
2017-07-12cli: add space separator for keyword, string, and int argumentsDavid Bremner
Defer the complication of optional boolean arguments for later (never?).
2017-07-12cli: change api of parse_optionDavid Bremner
The idea is to allow it (in a future commit) advance to the next argv element to get a value
2014-11-05cli: add support for hierarchical command line option arraysJani Nikula
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-01cli: Add support for parsing keyword-flag argumentsJani Nikula
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-02-25cli: command line option parser cleanupJani Nikula
Reduce the indentation for clarity. No functional changes.
2012-09-01cli: make the command line parser's errors more informative.Mark Walters
Previously, the cli parser was a little erratic in what errors it reported and would fail silently in many cases (for example, when no argument was passed to an integer option). This was particularly annoying as the user could not (easily) tell whether the command failed or just there were no search results. This patch tries to make the handling consistent and return a helpful error message in all cases.
2012-06-29cli: command line parsing: allow default for keyword optionsMark Walters
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-03-18cli: Parsing. Allow true/false parameter for boolean options.Mark Walters
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.
2011-12-13command-line-arguments.[ch]: make arrays of keyword descriptors constDavid Bremner
It seems like it should never be necessary to modify these arrays after initialization.
2011-12-08command-line-arguments.[ch]: new argument parsing framework for notmuch.David Bremner
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.