From 24695d682feac4c07014e14710cc4af2eb66e029 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 28 May 2000 19:40:22 +0000 Subject: use of _arguments for completion of a couple more builtins (11615) --- Completion/Builtins/_unhash | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'Completion/Builtins/_unhash') diff --git a/Completion/Builtins/_unhash b/Completion/Builtins/_unhash index fe40c25a2..b99c00ad3 100644 --- a/Completion/Builtins/_unhash +++ b/Completion/Builtins/_unhash @@ -1,6 +1,14 @@ -#defcomp unhash +#compdef unhash -[[ -mword 1 -*d* ]] && complist -n -[[ -mword 1 -*a* ]] && complist -a -[[ -mword 1 -*f* ]] && complist -F -[[ ! -mword 1 -* ]] && complist -m +local expl state line curcontext="$curcontext" + +_arguments -C -s \ + '(-a -f *)-d[remove named directories]:*:named directory:->nameddir' \ + '(-d -f *)-a[remove aliases]:*:aliases:_aliases' \ + '(-d -a *)-f[remove functions]:*:functions:_functions' \ + '-m[treat arguments as patterns]' \ + '*:commands:_command_names -e' && return 0 + +if [[ "$state" = nameddir ]]; then + _wanted nameddir expl 'named directory' compadd - ${(@k)nameddirs} +fi -- cgit 1.4.1