--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 155CB429E5D\r
+ for <notmuch@notmuchmail.org>; Wed, 6 Nov 2013 11:25:51 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id gCHgtYEtBnue for <notmuch@notmuchmail.org>;\r
+ Wed, 6 Nov 2013 11:25:43 -0800 (PST)\r
+Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com\r
+ [74.125.83.54]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client\r
+ certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
+ 065B9429E53 for <notmuch@notmuchmail.org>; Wed, 6 Nov 2013 11:25:42 -0800\r
+ (PST)\r
+Received: by mail-ee0-f54.google.com with SMTP id c50so2814647eek.27\r
+ for <notmuch@notmuchmail.org>; Wed, 06 Nov 2013 11:25:40 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id;\r
+ bh=7yytpoFUW5268d4CkCKPbbHnxEdNqpqBym4GWu4zmJ4=;\r
+ b=BloeKAJlea/HavyLcZpoL51PqvpGin6gKC0LM01jmXvW4l78cCXYipShKtf8HPyExY\r
+ u2/XUov5iRkVJoGcYpif3cUawdsDi0TRsefVBL2wBPVWm6OjukRPC3uP3L3ATXDOWDpF\r
+ 9PWdNZyR8hVma81fjOKaFw2UJ+ksG/dVY+jG/+Kp2jkGiBIkQDOao0Ixo92Xs/L2x3pB\r
+ +7bCxeTYC/dOh1+ngC1S47yIbRSklixfBEhsyIYM9M2cxisf8U1y45h5srG5g7A1Gfyj\r
+ BT8pgI5IRC+KQWcMdIQYHrP6j3jJdm+MuO+hideu6poUwrQ+trW70cxJSXkyfdkl0h2S\r
+ igCQ==\r
+X-Gm-Message-State:\r
+ ALoCoQkibZRMv3CT2VfJRn5n4Ky14u4et7928p9PUlUe59PNjnRpje+4AobQ8v0jjNEQ0kWEl4up\r
+X-Received: by 10.14.178.67 with SMTP id e43mr5496082eem.59.1383765940374;\r
+ Wed, 06 Nov 2013 11:25:40 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+ [88.195.111.91]) by mx.google.com with ESMTPSA id\r
+ u46sm77813724eep.17.2013.11.06.11.25.38 for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Wed, 06 Nov 2013 11:25:39 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] completion: update bash completion\r
+Date: Wed, 6 Nov 2013 21:25:37 +0200\r
+Message-Id: <1383765937-20921-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.8.4.rc3\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 06 Nov 2013 19:25:51 -0000\r
+\r
+Update bash completion to cover new commands and options:\r
+\r
+notmuch compact --quiet --backup=DIR\r
+notmuch count --output=files --batch --input=FILE\r
+notmuch insert --folder=DIR --create-folder\r
+notmuch search --exclude=all --duplicate=N\r
+notmuch show --include-html\r
+notmuch tag --batch --input=FILE --remove-all\r
+\r
+---\r
+\r
+This logically depends on id:cover.1383481295.git.jani@nikula.org\r
+which adds --quiet and --backup=DIR parameters to compact.\r
+---\r
+ completion/notmuch-completion.bash | 89 +++++++++++++++++++++++++++++++++++---\r
+ 1 file changed, 82 insertions(+), 7 deletions(-)\r
+\r
+diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash\r
+index 7bd7745..04324bb 100644\r
+--- a/completion/notmuch-completion.bash\r
++++ b/completion/notmuch-completion.bash\r
+@@ -59,6 +59,29 @@ _notmuch_search_terms()\r
+ __ltrim_colon_completions "${cur}"\r
+ }\r
+ \r
++_notmuch_compact()\r
++{\r
++ local cur prev words cword split\r
++ _init_completion -s || return\r
++\r
++ $split &&\r
++ case "${prev}" in\r
++ --backup)\r
++ _filedir\r
++ return\r
++ ;;\r
++ esac\r
++\r
++ ! $split &&\r
++ case "${cur}" in\r
++ -*)\r
++ local options="--backup= --quiet"\r
++ compopt -o nospace\r
++ COMPREPLY=( $(compgen -W "$options" -- ${cur}) )\r
++ ;;\r
++ esac\r
++}\r
++\r
+ _notmuch_config()\r
+ {\r
+ local cur prev words cword split\r
+@@ -89,19 +112,23 @@ _notmuch_count()\r
+ $split &&\r
+ case "${prev}" in\r
+ --output)\r
+- COMPREPLY=( $( compgen -W "messages threads" -- "${cur}" ) )\r
++ COMPREPLY=( $( compgen -W "messages threads files" -- "${cur}" ) )\r
+ return\r
+ ;;\r
+ --exclude)\r
+ COMPREPLY=( $( compgen -W "true false" -- "${cur}" ) )\r
+ return\r
+ ;;\r
++ --input)\r
++ _filedir\r
++ return\r
++ ;;\r
+ esac\r
+ \r
+ ! $split &&\r
+ case "${cur}" in\r
+ -*)\r
+- local options="--output= --exclude="\r
++ local options="--output= --exclude= --batch --input="\r
+ compopt -o nospace\r
+ COMPREPLY=( $(compgen -W "$options" -- ${cur}) )\r
+ ;;\r
+@@ -141,6 +168,39 @@ _notmuch_dump()\r
+ esac\r
+ }\r
+ \r
++_notmuch_insert()\r
++{\r
++ local cur prev words cword split\r
++ # handle tags with colons and equal signs\r
++ _init_completion -s -n := || return\r
++\r
++ $split &&\r
++ case "${prev}" in\r
++ --folder)\r
++ _filedir\r
++ return\r
++ ;;\r
++ esac\r
++\r
++ ! $split &&\r
++ case "${cur}" in\r
++ --*)\r
++ local options="--create-folder --folder="\r
++ compopt -o nospace\r
++ COMPREPLY=( $(compgen -W "$options" -- ${cur}) )\r
++ return\r
++ ;;\r
++ +*)\r
++ COMPREPLY=( $(compgen -P "+" -W "`notmuch search --output=tags \*`" -- ${cur##+}) )\r
++ ;;\r
++ -*)\r
++ COMPREPLY=( $(compgen -P "-" -W "`notmuch search --output=tags \*`" -- ${cur##-}) )\r
++ ;;\r
++ esac\r
++ # handle tags with colons\r
++ __ltrim_colon_completions "${cur}"\r
++}\r
++\r
+ _notmuch_new()\r
+ {\r
+ local cur prev words cword split\r
+@@ -231,7 +291,7 @@ _notmuch_search()\r
+ return\r
+ ;;\r
+ --exclude)\r
+- COMPREPLY=( $( compgen -W "true false flag" -- "${cur}" ) )\r
++ COMPREPLY=( $( compgen -W "true false flag all" -- "${cur}" ) )\r
+ return\r
+ ;;\r
+ esac\r
+@@ -239,7 +299,7 @@ _notmuch_search()\r
+ ! $split &&\r
+ case "${cur}" in\r
+ -*)\r
+- local options="--format= --output= --sort= --offset= --limit= --exclude="\r
++ local options="--format= --output= --sort= --offset= --limit= --exclude= --duplicate="\r
+ compopt -o nospace\r
+ COMPREPLY=( $(compgen -W "$options" -- ${cur}) )\r
+ ;;\r
+@@ -273,7 +333,7 @@ _notmuch_show()\r
+ ! $split &&\r
+ case "${cur}" in\r
+ -*)\r
+- local options="--entire-thread= --format= --exclude= --body= --format-version= --part= --verify --decrypt"\r
++ local options="--entire-thread= --format= --exclude= --body= --format-version= --part= --verify --decrypt --include-html"\r
+ compopt -o nospace\r
+ COMPREPLY=( $(compgen -W "$options" -- ${cur}) )\r
+ ;;\r
+@@ -287,9 +347,24 @@ _notmuch_tag()\r
+ {\r
+ local cur prev words cword split\r
+ # handle tags with colons and equal signs\r
+- _init_completion -n := || return\r
++ _init_completion -s -n := || return\r
++\r
++ $split &&\r
++ case "${prev}" in\r
++ --input)\r
++ _filedir\r
++ return\r
++ ;;\r
++ esac\r
+ \r
++ ! $split &&\r
+ case "${cur}" in\r
++ --*)\r
++ local options="--batch --input= --remove-all"\r
++ compopt -o nospace\r
++ COMPREPLY=( $(compgen -W "$options" -- ${cur}) )\r
++ return\r
++ ;;\r
+ +*)\r
+ COMPREPLY=( $(compgen -P "+" -W "`notmuch search --output=tags \*`" -- ${cur##+}) )\r
+ ;;\r
+@@ -307,7 +382,7 @@ _notmuch_tag()\r
+ \r
+ _notmuch()\r
+ {\r
+- local _notmuch_commands="config count dump help new reply restore search setup show tag"\r
++ local _notmuch_commands="compact config count dump help insert new reply restore search setup show tag"\r
+ local arg cur prev words cword split\r
+ _init_completion || return\r
+ \r
+-- \r
+1.8.4.rc3\r
+\r