From 6a86d34f28000280dd2518d49e9aa93fc4dc2a1c Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 6 Apr 2015 05:59:30 +0900 Subject: [PATCH] argument parsing refactor, add shared options --- 94/12caa9d0d84a8c70ffe55874865eb38fc179bd | 78 +++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 94/12caa9d0d84a8c70ffe55874865eb38fc179bd diff --git a/94/12caa9d0d84a8c70ffe55874865eb38fc179bd b/94/12caa9d0d84a8c70ffe55874865eb38fc179bd new file mode 100644 index 000000000..8bfc1e35e --- /dev/null +++ b/94/12caa9d0d84a8c70ffe55874865eb38fc179bd @@ -0,0 +1,78 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 6F1086DE1B50 + for ; Sun, 5 Apr 2015 14:34:15 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.631 +X-Spam-Level: +X-Spam-Status: No, score=0.631 tagged_above=-999 required=5 tests=[AWL=0.621, + T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 3RLnfj6N6Zqv for ; + Sun, 5 Apr 2015 14:34:13 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id 715F16DE1B5B + for ; Sun, 5 Apr 2015 14:34:13 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.80) (envelope-from ) + id 1Yeres-0002RV-Pp + for notmuch@notmuchmail.org; Sun, 05 Apr 2015 21:00:42 +0000 +Received: (nullmailer pid 29545 invoked by uid 1000); Sun, 05 Apr 2015 + 21:00:24 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: argument parsing refactor, add shared options +Date: Mon, 6 Apr 2015 05:59:30 +0900 +Message-Id: <1428267574-28797-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.4 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 05 Apr 2015 21:34:15 -0000 + +As part of ongoing hacking on Austin's revision tracking patches, I +wanted to add an option to (almost) all subcommands. One thing led to +another and this series emerged. By itself, the gain in functionality +is probably not worthwhile (yay, we can type notmuch subcommand +--version), but internally it makes it easy to add further "global +options" that are accepted as + +% notmuch --option [subcommand] + +and + +% notmuch subcommand --option + +it would make sense, e.g. for --quiet and --verbose to be supported +this way. + +Whatever people think about the shared options, I think the +refactoring of notmuch_help_command is probably worthwhile as it is +pretty simple and improves the readability of that code. + +Although there are other ways of doing so, patch 4 of this series also +fixes a UI bug encountered by Rob recently, where "--config" is silently ignored +in + + notmuch setup --config=/tmp/foo.conf + +In principle this series will need a documentation update, but note that + + notmuch search --help + +is already undocumented. + -- 2.26.2