mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 13:33:52 +01:00
add _arguments based completion for alias and jobs (13947)
This commit is contained in:
parent
80316c893f
commit
5c380d5ede
@ -1,3 +1,9 @@
|
||||
2001-04-11 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 13947: Completion/Zsh/Command/_fc, Completion/Zsh/Type/_aliases,
|
||||
Completion/Zsh/Type/_jobs_fg, Completion/Zsh/Command/_alias,
|
||||
Completion/Zsh/Command/_jobs_builtin: new _alias and _jobs_builtin
|
||||
|
||||
2001-04-11 Wayne Davison <wayned@users.sourceforge.net>
|
||||
|
||||
* 13942: Src/init.c, Doc/Zsh/func.yo: Fixed a bug in the
|
||||
|
8
Completion/Zsh/Command/_alias
Normal file
8
Completion/Zsh/Command/_alias
Normal file
@ -0,0 +1,8 @@
|
||||
#compdef alias
|
||||
|
||||
_arguments -C -s -A "-*" -S \
|
||||
'-+g[list or define global aliases]' \
|
||||
'-+r[list or define regular aliases]' \
|
||||
'-+m[print aliases matching specified pattern]' \
|
||||
'-L[print each alias in the form of calls to alias]' \
|
||||
'*::alias definition:_aliases -S ='
|
@ -1,13 +1,13 @@
|
||||
#compdef fc history r
|
||||
|
||||
local expl fc_common fc_hist fc_r
|
||||
local fc_common fc_hist fc_r
|
||||
|
||||
fc_common=(
|
||||
'(-A -R -W -I)-r[reverse order of the commands]'
|
||||
'(-A -R -W -I -e)-n[suppress line numbers]'
|
||||
'(-A -R -W -I)*::commands:_command_names -e' )
|
||||
|
||||
fc_hist=( \
|
||||
fc_hist=(
|
||||
'(-A -R -W -I)-m[treat first argument as a pattern]'
|
||||
'(-A -R -W -I -e -f -E -i)-d[print time-stamps]'
|
||||
'(-A -R -W -I -e -d -E -i)-f[mm/dd/yyyy format time-stamps]'
|
||||
@ -19,13 +19,13 @@ fc_r='(-A -R -W -I -e)-l[list resulting commands on stdout]'
|
||||
|
||||
case $service in
|
||||
history)
|
||||
_arguments -C -s -S "$fc_common[@]" "$fc_hist[@]" && return 0
|
||||
_arguments -s -S "$fc_common[@]" "$fc_hist[@]" && return 0
|
||||
;;
|
||||
r)
|
||||
_arguments -C -s -S "$fc_common[@]" "$fc_r" && return 0
|
||||
_arguments -s -S "$fc_common[@]" "$fc_r" && return 0
|
||||
;;
|
||||
*)
|
||||
_arguments -C -s -S \
|
||||
_arguments -s -S \
|
||||
'(-A -R -W -I -l -n -d -f -E -i -D)-e[specify editor to invoke]:editor to invoke:_command_names -e' \
|
||||
'(-l -m -e -r -n -d -f -E -i -D -A -W *)-R[read history from file]:history file:_files' \
|
||||
'(-l -m -e -r -n -d -f -E -i -D -R -W *)-A[append history to file]:history file:_files' \
|
||||
|
10
Completion/Zsh/Command/_jobs_builtin
Normal file
10
Completion/Zsh/Command/_jobs_builtin
Normal file
@ -0,0 +1,10 @@
|
||||
#compdef jobs
|
||||
|
||||
_arguments -C -s \
|
||||
"(-d -l -p -r -s *)-Z[specify string to replace shell's argument and environment with]:string" \
|
||||
'(-Z)-d[show directory from which to job was started]' \
|
||||
'(-Z)-l[list process IDs]' \
|
||||
'(-Z)-p[list process groups]' \
|
||||
'(-Z -s)-r[list only running jobs]' \
|
||||
'(-Z -r)-s[list only stopped jobs]' \
|
||||
'(-Z)*::job:_jobs'
|
@ -1,4 +1,4 @@
|
||||
#compdef alias unalias
|
||||
#compdef unalias
|
||||
|
||||
local expl sel args opts
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
#compdef disown fg jobs
|
||||
#compdef disown fg
|
||||
|
||||
_jobs
|
||||
|
Loading…
Reference in New Issue
Block a user