[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-235-g26ae770

Igor Murzov igor at gplsoft.org
Mon May 2 10:27:52 UTC 2011


The following commit has been merged in the master branch:
commit 1f453c97462f3668bb5743ed1bf10b1c933c4b7e
Author: Igor Murzov <igor at gplsoft.org>
Date:   Sun Jan 9 05:00:27 2011 +0300

    Improve completion for slackpkg

diff --git a/completions/slackpkg b/completions/slackpkg
index 1afa3b2..340e574 100644
--- a/completions/slackpkg
+++ b/completions/slackpkg
@@ -41,10 +41,6 @@ _slackpkg()
             # argument required but no completions available
             return 0
             ;;
-        install|reinstall|upgrade|remove|blacklist|download)
-            # FINISHME
-            return 0
-            ;;
         install-template|remove-template)
             if [ -e "$confdir/templates" ]; then
                 COMPREPLY=( $( (cd "$confdir/templates"; \
@@ -52,9 +48,21 @@ _slackpkg()
             fi
             return 0
             ;;
+        remove)
+            COMPREPLY=( $( (cd /var/log/packages; compgen -f -- "$cur") ) )
+            return 0
+            ;;
+        reinstall|upgrade)
+            # FIXME: ideally we should intersect list of installed packages
+            # with list of available packages
+            ;&
+        install|blacklist|download)
+            # FIXME: may be something better than just package names is possible
+            ;&
         info)
             COMPREPLY=( $( grep "^PACKAGE NAME: *$cur" \
-                ${WORKDIR}/PACKAGES.TXT 2>/dev/null | sed 's/^PACKAGE NAME: *//g' ) )
+                "${WORKDIR}/PACKAGES.TXT" 2>/dev/null | \
+                sed 's/^PACKAGE NAME: *//g' ) )
             return 0
             ;;
         update)

-- 
bash-completion



More information about the Bash-completion-commits mailing list