about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-10-21 16:11:09 +0200
committerOliver Kiddle <opk@zsh.org>2014-10-21 16:11:09 +0200
commitaf9f623273eb994d36d3f02ed37bac6edb10c7cb (patch)
treece9fb447962017a39bd067e3bb79921de15e0764 /Completion
parente02ff159b3e0254b783e67a9f8225893284aa213 (diff)
downloadzsh-af9f623273eb994d36d3f02ed37bac6edb10c7cb.tar.gz
zsh-af9f623273eb994d36d3f02ed37bac6edb10c7cb.tar.xz
zsh-af9f623273eb994d36d3f02ed37bac6edb10c7cb.zip
33481: resolve completion clashes and tidy-up SUSE/Mandriva related functions
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Mandriva/Command/_rebootin36
-rw-r--r--Completion/Unix/Type/_directories2
-rw-r--r--Completion/Unix/Type/_pdf2
-rw-r--r--Completion/Unix/Type/_pids2
-rw-r--r--Completion/openSUSE/Command/_SUSEconfig24
-rw-r--r--Completion/openSUSE/Command/_yast (renamed from Completion/Linux/Command/_yast)7
-rw-r--r--Completion/openSUSE/Command/_yast230
7 files changed, 32 insertions, 71 deletions
diff --git a/Completion/Mandriva/Command/_rebootin b/Completion/Mandriva/Command/_rebootin
index 1b69609f3..3f30b2591 100644
--- a/Completion/Mandriva/Command/_rebootin
+++ b/Completion/Mandriva/Command/_rebootin
@@ -1,27 +1,29 @@
 #compdef rebootin
 
+local context state line expl
+typeset -A opt_args
 local loader=$(sudo detectloader -q)
 
-_arguments -C -s \
+_arguments -s \
     '-n[no immediate reboot just set the flags for next reboot]' \
     '-f[create a /fastboot file to reboot in fastboot mode]' \
     '*::arguments:->loader_entry'
 
-local expl
 case $state in
-    loader_entry)
-	case $loader in
-	    GRUB)
-		if [ -r /boot/grub/menu.lst ];then
-		compadd ${${(M)${(f)"$(</boot/grub/menu.lst)"}##title *}#title }
-		fi
-		;;
-	    LILO)
-		if [ -r /etc/lilo.conf ];then
-		compadd $(awk -F= '{ if ($0 ~ /label=/) print $2 }' /etc/lilo.conf)
-		fi
-		;;
-	    *)
-		;;
-	esac
+  loader_entry)
+    case $loader in
+      GRUB)
+	if [ -r /boot/grub/menu.lst ]; then
+	  _wanted -C $context entries expl entry \
+	      compadd ${${(M)${(f)"$(</boot/grub/menu.lst)"}##title *}#title }
+	fi
+      ;;
+      LILO)
+	if [ -r /etc/lilo.conf ]; then
+	  _wanted -C $context entries expl entry \
+	      compadd $(awk -F= '{ if ($0 ~ /label=/) print $2 }' /etc/lilo.conf)
+	fi
+      ;;
+    esac
+  ;;
 esac
diff --git a/Completion/Unix/Type/_directories b/Completion/Unix/Type/_directories
index ab1b50b4f..702d31dc4 100644
--- a/Completion/Unix/Type/_directories
+++ b/Completion/Unix/Type/_directories
@@ -1,4 +1,4 @@
-#compdef rmdir df dircmp -P -value-,*path,-default-
+#compdef rmdir dircmp -P -value-,*path,-default-
 
 local expl
 
diff --git a/Completion/Unix/Type/_pdf b/Completion/Unix/Type/_pdf
index f20f94e79..60cee84ee 100644
--- a/Completion/Unix/Type/_pdf
+++ b/Completion/Unix/Type/_pdf
@@ -1,4 +1,4 @@
-#compdef pdf2dsc pdf2ps pdfimages pdfinfo pdftopbm pdftops pdftotext pdfopt pdffonts kpdf apvlv evince epdfview
+#compdef pdf2dsc pdf2ps pdfimages pdfinfo pdftopbm pdftops pdftotext pdfopt pdffonts kpdf apvlv epdfview
 
 local expl ext=''
 
diff --git a/Completion/Unix/Type/_pids b/Completion/Unix/Type/_pids
index 3c6a76561..cf9000538 100644
--- a/Completion/Unix/Type/_pids
+++ b/Completion/Unix/Type/_pids
@@ -1,4 +1,4 @@
-#compdef pflags pcred pmap pldd psig pstack pfiles pwdx pstop prun pwait ptree
+#compdef pflags pcred pmap pldd psig pstack pfiles pwdx pstop prun pwait
 
 # If given the `-m <pattern>' option, this tries to complete only pids
 # of processes whose command line match the `<pattern>'.
diff --git a/Completion/openSUSE/Command/_SUSEconfig b/Completion/openSUSE/Command/_SUSEconfig
index d50828529..737a80b17 100644
--- a/Completion/openSUSE/Command/_SUSEconfig
+++ b/Completion/openSUSE/Command/_SUSEconfig
@@ -1,15 +1,7 @@
 #compdef SuSEconfig
 
-local curcontext="$curcontext" state line
-typeset -A opt_args
-
-if [[ -z "$_SuSEconfig_modules" ]]; then 
-	for i in /sbin/conf.d/SuSEconfig.*; do
-		case $i in *.rpm*|*.swap|*.bak|*.orig|*~|\#*) continue;; esac
-		_SuSEconfig_modules=($_SuSEconfig_modules ${i##*/SuSEconfig.})
-	done
-fi
-
+local modules
+modules=( /sbin/conf.d/SuSEconfig.*~(*.rpm*|*.swap|*.bak|*.orig|*~|\#*)(N:e) )
 
 _arguments \
   '--help' \
@@ -17,12 +9,6 @@ _arguments \
   '--force' \
   '--verbose' \
   '--nonewpackage' \
-  '--module:module:->module' && return 0
-
-case $state in
-	module) compadd $_SuSEconfig_modules ;;
-esac
-
-# Usage: SuSEconfig [--quick|--nonewpackage|--force|--verbose] [--module name]
-
-
+  '-norestarts' \
+  '-nomodule' \
+  '--module:module:compadd -a modules'
diff --git a/Completion/Linux/Command/_yast b/Completion/openSUSE/Command/_yast
index f008b404f..98585f068 100644
--- a/Completion/Linux/Command/_yast
+++ b/Completion/openSUSE/Command/_yast
@@ -3,9 +3,12 @@
 _arguments \
   '(- 1)'{-h,--help}'[display help information]' \
   '(- 1)'{-l,--list}'[list all available modules]' \
-  '(-g --geometry)'{-g,--geometry}'[specify default window size]:_x_geometry' \
-  '(-s --style)'{-s,--style}'[specify widget style]:style:(qt)' \
+  '(-g --geometry --ncurses)'{-g,--geometry}'[specify default window size]:_x_geometry' \
+  '--qt[use the QT graphical frontend]' \
+  '--gtk[use the GTK graphical frontend]' \
+  '--ncurses[use the curses text-mode frontend]' \
   '--noborder[no window manager border for main window]' \
   '--fullscreen[use full screen]' \
   '(-)'{-i,--install}'[install package]:*:package file:_files -g "*.rpm(-.)"' \
+  '(-)--remove[remove package]:*:package' \
   '1:module:( ${${(f)"$($words[1] -l 2>/dev/null)"}[2,-1]##* } )'
diff --git a/Completion/openSUSE/Command/_yast2 b/Completion/openSUSE/Command/_yast2
deleted file mode 100644
index b9c7f2489..000000000
--- a/Completion/openSUSE/Command/_yast2
+++ /dev/null
@@ -1,30 +0,0 @@
-#compdef yast2 yast
-
-local curcontext="$curcontext" state line
-typeset -A opt_args
-
-if [[ -z "$_yast2_modules" ]]; then 
-	for i in $(/sbin/yast2 --list | grep -v "Available.*modules"); do
-		_yast2_modules=($_yast2_modules $i)
-	done
-fi
-
-_arguments -s \
-  '(--list)-l[list all available modules]' '(-l)--list' \
-  '(--help)-h[help]' '(-h)--help'\
-  \
- {'(--geometry)-g[default window size (qt only)]','(-g)--geometry'}':geometry:(800x600+0+0)' \
-  '(--style)-s[widget style (qt only)]' '(-s)--style' \
-  \
- {'(--install)-i[install rpm package]','(-i)--install'}':filename:_files' \
-  \
- '--noborder[no window manager border for main window]' '--noborder' \
- '--fullscreen[use full screen]' '--fullscreen' \
-  \
-  ':module:->module' && return 0
-
-case $state in
-	module) compadd $_yast2_modules; _files -g "*.ycp";;
-esac
-
-