From 006e9b9afba10e2e64d86538fe5777376c8f0f57 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 26 Feb 2001 13:02:30 +0000 Subject: change $words[1] to $service in some more places (13534) --- Completion/Builtins/_fc | 2 +- Completion/Builtins/_hash | 2 +- Completion/Builtins/_source | 15 +++++++++++---- Completion/Builtins/_which | 2 +- Completion/Builtins/_zftp | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) (limited to 'Completion/Builtins') diff --git a/Completion/Builtins/_fc b/Completion/Builtins/_fc index e97492604..cb3efe48f 100644 --- a/Completion/Builtins/_fc +++ b/Completion/Builtins/_fc @@ -13,7 +13,7 @@ fc_common=( \ '(-A -R -W -I -e)-D[print elapsed times]' \ '(-A -R -W -I)*::commands:_command_names -e' ) -if [[ $words[1] = *history ]]; then +if [[ $service = *history ]]; then _arguments -C -s "$fc_common[@]" else _arguments -C -s \ diff --git a/Completion/Builtins/_hash b/Completion/Builtins/_hash index 250e119b9..8d7e51503 100644 --- a/Completion/Builtins/_hash +++ b/Completion/Builtins/_hash @@ -7,7 +7,7 @@ common_args=( \ '-d[use named directory hash table]' \ '(-r -m -v)-f[rebuild hash table]' ) -case ${words[1]} in +case ${service} in hash) _arguments -C -s \ '(-f -m -v)-r[empty hash table]' \ diff --git a/Completion/Builtins/_source b/Completion/Builtins/_source index aae2c7320..96b6c21bd 100644 --- a/Completion/Builtins/_source +++ b/Completion/Builtins/_source @@ -1,7 +1,14 @@ -#defcomp source +#compdef source . -if [[ -position 2 -1 ]]; then - _normal "$@" +if [[ CURRENT -ge 3 ]]; then + compset -n 2 + _normal else - _files + if [[ -prefix */ && ! -o pathdirs ]]; then + _files + elif [[ $service = . ]]; then + _files -W path + else + _files -W "(. $path)" + fi fi diff --git a/Completion/Builtins/_which b/Completion/Builtins/_which index aceec85a0..da78b9358 100644 --- a/Completion/Builtins/_which +++ b/Completion/Builtins/_which @@ -11,7 +11,7 @@ cargs=( \ farg='-f[output contents of functions]' aarg='-a[print all occurences in path]' -case ${words[1]} in +case ${service} in whence) _arguments -C -s \ '(-c -w)-v[verbose output]' \ diff --git a/Completion/Builtins/_zftp b/Completion/Builtins/_zftp index 610af2607..ca6c59fec 100644 --- a/Completion/Builtins/_zftp +++ b/Completion/Builtins/_zftp @@ -11,7 +11,7 @@ _compskip=all local subcom expl curcontext="${curcontext}" -if [[ $words[1] = zftp ]]; then +if [[ $service = zftp ]]; then if [[ $CURRENT -eq 2 ]]; then _wanted commands expl sub-command \ compadd open params user login type ascii binary mode put \ @@ -22,7 +22,7 @@ if [[ $words[1] = zftp ]]; then subcom=$words[2] curcontext="${curcontext/:zftp:/:zftp-${words[2]}:}" else - subcom=$words[1] + subcom=$service fi case $subcom in -- cgit 1.4.1