aboutsummaryrefslogtreecommitdiff
path: root/completion
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-10-18 21:41:58 +0200
committerDavid Bremner <david@tethera.net>2022-11-05 13:18:15 -0400
commit793f2980910f612fa33806ef71fa7ee35d093657 (patch)
tree693d82c511730bbf407cce43491242590f2456ba /completion
parentb6565c1c54e35563843e7ddece601680170bb84a (diff)
cli: add options --offset and --limit to notmuch show
notmuch search does not output header values. However, when browsing through a large email corpus, it can be time saving to be able to paginate without running notmuch show for each message/thread. Add --offset and --limit options to notmuch show. This is inspired from commit 796b629c3b82 ("cli: add options --offset and --limit to notmuch search"). Update man page, shell completion and add a test case to ensure it works as expected. Cc: Tim Culverhouse <tim@timculverhouse.com> Cc: Tomi Ollila <tomi.ollila@iki.fi> Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'completion')
-rw-r--r--completion/notmuch-completion.bash2
-rw-r--r--completion/zsh/_notmuch2
2 files changed, 3 insertions, 1 deletions
diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash
index 0022b54b..3748846e 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -530,7 +530,7 @@ _notmuch_show()
! $split &&
case "${cur}" in
-*)
- local options="--entire-thread= --format= --exclude= --body= --format-version= --part= --verify --decrypt= --include-html ${_notmuch_shared_options}"
+ local options="--entire-thread= --format= --exclude= --body= --format-version= --part= --verify --decrypt= --include-html --limit= --offset= ${_notmuch_shared_options}"
compopt -o nospace
COMPREPLY=( $(compgen -W "$options" -- ${cur}) )
;;
diff --git a/completion/zsh/_notmuch b/completion/zsh/_notmuch
index e207d90b..0bdd7f77 100644
--- a/completion/zsh/_notmuch
+++ b/completion/zsh/_notmuch
@@ -245,6 +245,8 @@ _notmuch_show() {
'--exclude=[respect excluded tags setting]:exclude tags:(true false)' \
'--body=[output body]:output body content:(true false)' \
'--include-html[include text/html parts in the output]' \
+ '--limit=[limit the number of displayed results]:limit: ' \
+ '--offset=[skip displaying the first N results]:offset: ' \
'*::search term:_notmuch_search_term'
}