feat(self-update): support -n/--no-pager

Issue #632: the pager machinery already recognized -n/--no-pager
globally and .zinit-pager already honors OPTS[opt_-n,--no-pager], but
self-update rejected the flag with "Incorrect options given". Allow it
so the commit list can be printed straight to the terminal; help and
error output pick the flag up automatically from the option map. Also
offer the flag in the _zinit completion.

Closes #632

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
Vladislav Doster 2026-08-31 15:50:14 -05:00
parent 9a2898ba2a
commit cc3baf395f
2 changed files with 2 additions and 1 deletions

1
_zinit
View file

@ -275,6 +275,7 @@ _zinit_run(){
_zinit_self_update(){
_arguments -A \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-n --no-pager)'{-n,--no-pager}'[Disable the use of the pager]' \
'(-q --quiet)'{-q,--quiet}'[Turn off messages from the operation]' \
&& ret=0
} # ]]]

View file

@ -2713,7 +2713,7 @@ zinit() {
light "--help|-b|-h"
snippet "--command|--force|--help|-f|-h|-x"
times "--help|-h|-m|-s"
self-update "--help|--quiet|-h|-q"
self-update "--help|--no-pager|--quiet|-h|-n|-q"
unload "--help|--quiet|-h|-q"
update "--all|--help|--no-pager|--parallel|--plugins|--quiet|--reset|--snippets|--urge|--verbose|-L|-a|-h|-n|-p|-q|-r|-s|-u|-v"
version ""