about summary refs log tree commit diff
path: root/Completion/User/_wget
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/User/_wget')
-rw-r--r--Completion/User/_wget27
1 files changed, 12 insertions, 15 deletions
diff --git a/Completion/User/_wget b/Completion/User/_wget
index 0e56df355..fbacc5b27 100644
--- a/Completion/User/_wget
+++ b/Completion/User/_wget
@@ -1,11 +1,11 @@
 #compdef wget
 
-local state line
-typeset -A options
+local curcontext="$curcontext" state line
+typeset -A opt_args
 
 local tmp1 tmp2
 
-_arguments -s \
+_arguments -C -s \
   '(--version)-V[version]' '(-V)--version' \
   '(--help)-h[help]' '(-h)--help' \
   '(--background)-b[background]' '(-b)--background' \
@@ -68,7 +68,7 @@ _arguments -s \
   '--cache=:cache:(on off)' \
   '--htmlify=:htmlify:' \
   '--no:no:->noflags' \
-  '*:url:_urls'
+  '*:url:_urls' && return 0
 
 #  '--backups:backups:' \
 #  '-W' \
@@ -78,16 +78,13 @@ _arguments -s \
 
 case "$state" in
 noflags)
-  tmp1=(
-    'v:non verbose'
-    'h:no host lookup'
-    'H:no host directories'
-    'd:no directories'
-    'c:no clobber'
-    'r:don'\''t remove listing'
-    'p:no parent'
-  )
-  tmp2=(${PREFIX}${^tmp1%%:*})
-  _describe -o option tmp1 tmp2
+  _values -s '' 'option' \
+    'v[non verbose]' \
+    'h[no host lookup]' \
+    'H[no host directories]' \
+    'd[no directories]' \
+    'c[no clobber]' \
+    'r[don'\''t remove listing]' \
+    'p[no parent]'
   ;;
 esac