[PATCH 0/2] cli: Parsing. Add option NOTMUCH_OPT_INT_OR_BOOLEAN
Mark Walters
markwalters1009 at gmail.com
Thu Mar 8 14:15:42 PST 2012
The first patch adds a new command line parsing option
NOTMUCH_OPT_INT_OR_BOOLEAN for command line parsing which accepts
--verbose=3 and --verbose with the latter setting verbose to 1. It
also allows --verbose=0 so (with a little caller support) the user can
turn off boolean options.
It also means that extra options can be added to the command line
programs in a backwards compatible manner (e.g. if --verbose already
exists we could add --verbose=2).
The second patch uses this to make the --entire-thread option to
notmuch-show a NOTMUCH_OPT_INT_OR_BOOLEAN. In particular this allows
the caller to disable --entire-thread (with --entire-thread=0) when
format=json.
Best wishes
Mark
Mark Walters (2):
cli: Parsing. Add option NOTMUCH_OPT_INT_OR_BOOLEAN
cli: make --entire-thread option notmuch-show.c INT_OR_BOOLEAN
command-line-arguments.c | 29 +++++++++++++++++++++++++++--
command-line-arguments.h | 3 +++
notmuch-show.c | 10 ++++++++--
3 files changed, 38 insertions(+), 4 deletions(-)
--
1.7.9.1
More information about the notmuch
mailing list