From 733ccfabca350f65a1d0ba1f64792a8a436da273 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sat, 14 Oct 2017 16:15:43 +0300 Subject: cli: allow empty strings for notmuch insert --folder argument Now that it's easy to add argument specific modifiers in opt descriptions, add a new .allow_empty field to allow empty strings for individual string arguments while retaining strict checks elsewhere. Use this for notmuch insert --folder, where the empty string means top level folder. --- command-line-arguments.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'command-line-arguments.h') diff --git a/command-line-arguments.h b/command-line-arguments.h index 76ca4dcb..c0228f7c 100644 --- a/command-line-arguments.h +++ b/command-line-arguments.h @@ -32,6 +32,9 @@ typedef struct notmuch_opt_desc { /* Optional, if non-NULL, set to true if the option is present. */ bool *present; + /* Optional, allow empty strings for opt_string. */ + bool allow_empty; + /* Must be set for opt_keyword and opt_flags. */ const struct notmuch_keyword *keywords; } notmuch_opt_desc_t; -- cgit v1.2.3