diff options
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r-- | Completion/Zsh/Command/_print | 32 | ||||
-rw-r--r-- | Completion/Zsh/Command/_read | 21 | ||||
-rw-r--r-- | Completion/Zsh/Command/_unhash | 14 |
3 files changed, 67 insertions, 0 deletions
diff --git a/Completion/Zsh/Command/_print b/Completion/Zsh/Command/_print new file mode 100644 index 000000000..af0501b7a --- /dev/null +++ b/Completion/Zsh/Command/_print @@ -0,0 +1,32 @@ +#compdef print + +local state expl line eflag pflag + +# -e flag available only after -R +eflag="${words[1,CURRENT-1][(r)-*R*]:+-e[enable escapes]}" + +# -p flag only relevant if we have a coprocess +(:>&p) 2>/dev/null && + pflag='(-s -u -z)-p[print arguments to input of coprocess]' + +_arguments -C -s -A "-*" -S \ + '(-f)-r[ignore escape conventions of echo]' \ + '(-r -b -f -m -s -l -N -o -O -i -c -u -p -z -D -P)-R[emulate BSD echo (no escapes, -n & -e flags only)]' \ + '-b[recognise bindkey escape sequences]' \ + '-m[remove arguments matching specified pattern]' \ + '(-r -n -R -l -N -c)-f+[print arguments as for the printf builtin]:format' \ + '(-u -p -z)-s[place results in the history list]' \ + '(-c -f)-n[do not add a newline to the result]' \ + '(-N -c -f)-l[print arguments separated by newlines]' \ + '(-n -l -c -f)-N[print arguments separated and terminated by nulls]' \ + '(-O)-o[sort arguments in ascending order]' \ + '(-o)-O[sort arguments in descending order]' \ + '-i[case-insensitive sorting]' \ + '(-n -l -N -f -s -z)-a[with -c/-C, print arguments across before down]' \ + '(-n -l -N -f -C -s -z)-c[print arguments in columns]' \ + '(-n -l -N -f -c -s -z)-C+[print arguments in specified number of columns]:columns' \ + '(-s -p -z)-u+[specify file descriptor to print arguments to]:file descriptor:_file_descriptors' \ + '(-s -p -u)-z[push arguments onto editing buffer stack]' \ + '-D[substitute any arguments which are named directories using ~ notation]' \ + '-P[perform prompt expansion]' \ + $pflag $eflag '*:default:_default' diff --git a/Completion/Zsh/Command/_read b/Completion/Zsh/Command/_read new file mode 100644 index 000000000..1f733b0e8 --- /dev/null +++ b/Completion/Zsh/Command/_read @@ -0,0 +1,21 @@ +#compdef read + +local pflag + +# -p flag only relevant if we have a coprocess +(:>&p) 2>/dev/null && + pflag='(-q -s -u -z)-p[input is read from the coprocess]' + +_arguments -s -A "-*" -S \ + '-r[raw mode]' \ + '(-p -k -s -u -z)-q[read y or n character from terminal]' \ + '(-q)-k+[specify number of characters to read]:: :_guard "[0-9]#" "number of characters"' \ + '(-q -z)-t+[test if input is available before reading]:: :_guard "[0-9.]#" "timeout (seconds)"' \ + '(-q)-d[specify delimiter to terminate input instead of newline]:delimiter' \ + '(-q -s -u -p -t)-z[read entry from editor buffer stack]' \ + '(-E)-e[input read is echoed and not assigned]' \ + '(-e)-E[input read is echoed]' \ + '(-q -z -p)-s[suppress terminal echoing]' \ + '-A[first name is taken as an array]' \ + '(-q -z -p)-u+[specify file descriptor to read from]:file descriptor:_file_descriptors' \ + $pflag '1:varprompt:_vars -qS\?' '*:vars:_vars' diff --git a/Completion/Zsh/Command/_unhash b/Completion/Zsh/Command/_unhash new file mode 100644 index 000000000..c05c27ea3 --- /dev/null +++ b/Completion/Zsh/Command/_unhash @@ -0,0 +1,14 @@ +#compdef unhash + +local expl state line curcontext="$curcontext" + +_arguments -C -s -S \ + '(-a -f -s *)-d[remove named directories]:*:named directory:->nameddir' \ + '(-d -f -s *)-a[remove aliases]:*:alias:_aliases' \ + '(-a -d -f *)-s[remove suffix aliases]:*:suffix alias:_aliases -s s' \ + '(-d -a -s *)-f[remove functions]:*:shell function:_functions' \ + '-m[treat arguments as patterns]' \ + '(-a -d -f -m)*:command: _command_names -e' && return 0 + +[[ "$state" = nameddir ]] && + _wanted named-directories expl 'named directory' compadd -k nameddirs |