From 48e4ce2f6d05e207cbfbacc5c13a05612fe702c9 Mon Sep 17 00:00:00 2001 From: Kid Date: Sat, 21 Aug 2021 22:22:10 +0800 Subject: [PATCH] Add and fix completions for new options --- share/completions/commandline.fish | 1 + share/completions/string.fish | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/share/completions/commandline.fish b/share/completions/commandline.fish index 1be6b2164..245a45ec8 100644 --- a/share/completions/commandline.fish +++ b/share/completions/commandline.fish @@ -19,6 +19,7 @@ complete -c commandline -s C -l cursor -d "Set/get cursor position, not buffer c complete -c commandline -s L -l line -d "Print the line that the cursor is on" complete -c commandline -s S -l search-mode -d "Return true if performing a history search" complete -c commandline -s P -l paging-mode -d "Return true if showing pager content" +complete -c commandline -l is-valid -d "Return true if the command line is syntactically valid and complete" complete -c commandline -n '__fish_contains_opt -s f function' -a '(bind --function-names)' -d 'Function name' -x diff --git a/share/completions/string.fish b/share/completions/string.fish index 356648ef1..b4867f244 100644 --- a/share/completions/string.fish +++ b/share/completions/string.fish @@ -6,7 +6,7 @@ complete -f -c string -n "test (count (commandline -opc)) -ge 2; and not contain complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a lower complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a upper complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a length -complete -f -c string -n "test (count (commandline -opc)) -ge 2; and contains -- (commandline -opc)[2] length" -s v -l visible -d "Use the visible width, excluding escape sequences" +complete -f -c string -n "test (count (commandline -opc)) -ge 2; and contains -- (commandline -opc)[2] length" -s V -l visible -d "Use the visible width, excluding escape sequences" complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a sub complete -x -c string -n "test (count (commandline -opc)) -ge 2; and contains -- (commandline -opc)[2] sub" -s s -l start -xa "(seq 1 10)" complete -x -c string -n "test (count (commandline -opc)) -ge 2; and contains -- (commandline -opc)[2] sub" -s e -l end -xa "(seq 1 10)" @@ -19,6 +19,7 @@ complete -f -c string -n 'test (count (commandline -opc)) -ge 2; and string matc complete -f -c string -n 'test (count (commandline -opc)) -ge 2; and string match -qr split0\?\$ -- (commandline -opc)[2]' -s n -l no-empty -d "Empty results excluded" complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a collect complete -f -c string -n 'test (count (commandline -opc)) -ge 2; and string match -qr collect\$ -- (commandline -opc)[2]' -s N -l no-trim-newlines -d "Don't trim trailing newlines" +complete -f -c string -n 'test (count (commandline -opc)) -ge 2; and string match -qr collect\$ -- (commandline -opc)[2]' -s a -l allow-empty -d "Always print empty argument" complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a join complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a join0 @@ -38,6 +39,7 @@ complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a match complete -f -c string -n "test (count (commandline -opc)) -ge 2; and contains -- (commandline -opc)[2] match" -s n -l index -d "Report index, length of match" complete -f -c string -n "test (count (commandline -opc)) -ge 2; and contains -- (commandline -opc)[2] match" -s v -l invert -d "Report only non-matches" complete -f -c string -n "test (count (commandline -opc)) -ge 2; and contains -- (commandline -opc)[2] match" -s e -l entire -d "Show entire matching lines" +complete -f -c string -n "test (count (commandline -opc)) -ge 2; and contains -- (commandline -opc)[2] match" -s g -l groups-only -d "Only report capturing groups" complete -f -c string -n "test (count (commandline -opc)) -lt 2" -a replace complete -f -c string -n "test (count (commandline -opc)) -ge 2; and contains -- (commandline -opc)[2] replace" -s f -l filter -d "Report only actual replacements" # All replace options are also valid for match