summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_less
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:17:48 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:17:48 +0200
commitb09f4483416c54c1782824633dfabaf2ec0265b6 (patch)
tree304bc82642862525ae680c7fbaa249663b10ad57 /Completion/Unix/Command/_less
parent12eb3e5356f2fc3351eed58ef1cef1b8fb83b504 (diff)
parent6e55c920503071e917619b8cb1a188cd35d772db (diff)
downloadzsh-b09f4483416c54c1782824633dfabaf2ec0265b6.tar.gz
zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.zip
New upstream version 5.8.1.2-test
Diffstat (limited to 'Completion/Unix/Command/_less')
-rw-r--r--Completion/Unix/Command/_less43
1 files changed, 37 insertions, 6 deletions
diff --git a/Completion/Unix/Command/_less b/Completion/Unix/Command/_less
index cb71314a6..69f75fd0e 100644
--- a/Completion/Unix/Command/_less
+++ b/Completion/Unix/Command/_less
@@ -1,7 +1,7 @@
#compdef less -value-,LESS,-default- -value-,LESSCHARSET,-default-
-local curcontext="$curcontext" state line expl ret=1
-local -a files
+local curcontext="$curcontext" fgbg=foreground ret=1
+local -a state line expl files basic suf
case $service in
*LESSCHARSET*)
@@ -37,15 +37,15 @@ _arguments -S -s -A "[-+]*" \
'(-b --buffers)'{-b+,--buffers=}'[specify amount of buffer space used for each file]:buffer space (kilobytes)' \
'(-B --auto-buffers)'{-B,--auto-buffers}"[don't automatically allocate buffers for pipes]" \
'(-C --CLEAR-SCREEN -c --clear-screen)'{-c,--clear-screen}'[repaint screen instead of scrolling]' \
- '(-c --clear-screen -C --CLEAR-SCREEN)'{-C,--CLEAR-SCREEN}'[clear screen before repaints]' \
+ '!(-c --clear-screen)'{-C,--CLEAR-SCREEN} \
'(-d --dumb)'{-d,--dumb}'[suppress error message if terminal is dumb]' \
+ '*'{-D+,--color=}'[set screen colors]: :->colors' \
'(-e -E --quit-at-eof --QUIT-AT-EOF)'{-e,--quit-at-eof}'[exit the second time end-of-file is reached]' \
'(-e -E --quit-at-eof --QUIT-AT-EOF)'{-E,--QUIT-AT-EOF}'[exit when end-of-file is reached]' \
'(-f --force)'{-f,--force}'[force opening of non-regular files]' \
'(-F --quit-if-one-screen)'{-F,--quit-if-one-screen}'[exit if entire file fits on first screen]' \
'(-G --HILITE-SEARCH -g --hilite-search)'{-g,--hilite-search}'[highlight only one match for searches]' \
'(-g --hilite-search -G --HILITE-SEARCH)'{-G,--HILITE-SEARCH}'[disable highlighting of search matches]' \
- '--old-bot[revert to the old bottom of screen behavior]' \
'(-h --max-back-scroll)'{-h+,--max-back-scroll=}'[specify backward scroll limit]:backward scroll limit (lines)' \
'(-I --IGNORE-CASE -i --ignore-case)'{-i,--ignore-case}'[ignore case in searches that lack uppercase]' \
'(-i --ignore-case -I --IGNORE-CASE)'{-I,--IGNORE-CASE}'[ignore case in all searches]' \
@@ -80,21 +80,52 @@ _arguments -S -s -A "[-+]*" \
'--no-keypad[disable use of keypad terminal init string]' \
'(-y --max-forw-scroll)'{-y,--max-forw-scroll}'[specify forward scroll limit]' \
'(-z --window)'{-z+,--window=}'[specify scrolling window size]:lines' \
- '(-\" --quotes)'{-\"+,--quotes=}'[change quoting character]:quoting characters' \
+ '(-\" --quotes)'{'-\"+',--quotes=}'[change quoting character]:quoting characters' \
'(-~ --tilde)'{-~,--tilde}"[don't display tildes after end of file]" \
- '(-\# --shift)'{-\#+,--shift=}"[specify amount to move when scrolling horizontally]:number" \
+ '(-\# --shift)'{'-\#+',--shift=}"[specify amount to move when scrolling horizontally]:number" \
+ '--file-size[automatically determine the size of the input file]' \
+ '--incsearch[search file as each pattern character is typed in]' \
+ '--line-num-width=[set the width of line number field]:width [7]' \
'--follow-name[the F command changes file if the input file is renamed]' \
'--mouse[enable mouse input]' \
'--no-histdups[remove duplicates from command history]' \
'--rscroll=[set the character used to mark truncated lines]:character [>]' \
'--save-marks[retain marks across invocations of less]' \
+ '--status-col-width=[set the width of the -J status column]:width [2]' \
'--use-backslash[subsequent options use backslash as escape char]' \
+ '--use-color[enable colored text]' \
'--wheel-lines=[specify lines to move for each click of the mouse wheel]:lines' \
"$files[@]" && ret=0
if [[ -n "$state" ]]; then
case $state in
+ colors)
+ if compset -P 1 \?; then
+ [[ $IPREFIX[-1] != [a-z] ]] || compset -P 1 + || _describe 'color application' '( +:add\ to\ existing\ attribute )'
+ suf=( -S '' )
+ compset -P 1 '([-a-zA-Z]|*.)' && fgbg=background && suf=()
+ basic=( B:blue C:cyan G:green K:black M:magenta R:red W:white Y:yellow )
+ _describe -t colors "$fgbg color" \
+ "( -:default ${(j. .)${(@)basic/:/:light\ }} ${(Lj. .)basic} )" "$suf[@]" && ret=0
+ else
+ _describe 'text' '(
+ B:binary\ characters
+ C:control\ characters
+ E:errors\ and\ informational\ messages
+ M:mark\ letters\ in\ the\ status\ column
+ N:line\ numbers\ enabled\ via\ the\ -N\ option
+ P:prompts
+ R:the\ rscroll\ character
+ S:search\ results
+ W:the\ highlight\ enabled\ via\ the\ -w\ option
+ d:bold\ text
+ k:blinking\ text
+ s:standout\ text
+ u:underlined\ text
+ )' -S '' && ret=0
+ fi
+ ;;
prompts)
if compset -p 1; then
_message -e prompt