From af9f623273eb994d36d3f02ed37bac6edb10c7cb Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 21 Oct 2014 16:11:09 +0200 Subject: 33481: resolve completion clashes and tidy-up SUSE/Mandriva related functions --- Completion/openSUSE/Command/_SUSEconfig | 24 +++++------------------- Completion/openSUSE/Command/_yast | 14 ++++++++++++++ Completion/openSUSE/Command/_yast2 | 30 ------------------------------ 3 files changed, 19 insertions(+), 49 deletions(-) create mode 100644 Completion/openSUSE/Command/_yast delete mode 100644 Completion/openSUSE/Command/_yast2 (limited to 'Completion/openSUSE') 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/openSUSE/Command/_yast b/Completion/openSUSE/Command/_yast new file mode 100644 index 000000000..98585f068 --- /dev/null +++ b/Completion/openSUSE/Command/_yast @@ -0,0 +1,14 @@ +#compdef yast yast2 + +_arguments \ + '(- 1)'{-h,--help}'[display help information]' \ + '(- 1)'{-l,--list}'[list all available modules]' \ + '(-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 - - -- cgit 1.4.1