about summary refs log tree commit diff
path: root/Completion/Builtins
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-02-26 13:02:30 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-02-26 13:02:30 +0000
commit006e9b9afba10e2e64d86538fe5777376c8f0f57 (patch)
tree4cba2693f257bb5392faa929731bf5bcfdff8de0 /Completion/Builtins
parent85de1eae0bbd3e94fa73cb56cb847d3edff99f59 (diff)
downloadzsh-006e9b9afba10e2e64d86538fe5777376c8f0f57.tar.gz
zsh-006e9b9afba10e2e64d86538fe5777376c8f0f57.tar.xz
zsh-006e9b9afba10e2e64d86538fe5777376c8f0f57.zip
change $words[1] to $service in some more places (13534)
Diffstat (limited to 'Completion/Builtins')
-rw-r--r--Completion/Builtins/_fc2
-rw-r--r--Completion/Builtins/_hash2
-rw-r--r--Completion/Builtins/_source15
-rw-r--r--Completion/Builtins/_which2
-rw-r--r--Completion/Builtins/_zftp4
5 files changed, 16 insertions, 9 deletions
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