improve bash completions and related delivery mechanism
authorBdale Garbee <bdale@gag.com>
Mon, 6 Apr 2009 16:24:37 +0000 (09:24 -0700)
committerBdale Garbee <bdale@gag.com>
Mon, 6 Apr 2009 16:24:37 +0000 (09:24 -0700)
debian/bash_completion
debian/changelog
debian/rules

index 71852c05a8f641cdeea8671068e4166b80000fe0..fc4a265d405f5c1021d2dd080ef9982e0098ce24 100644 (file)
@@ -1,13 +1,14 @@
-# mtx completion by Jon Middleton <jjm@ixtab.org.uk>
+# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
+# ex: ts=8 sw=8 noet filetype=sh
 #
-# $Id: bash_completion,v 1.1 2004-02-15 05:43:25 bdale Exp $
+# mtx completion by Jon Middleton <jjm@ixtab.org.uk>
 
 _mtx()
 {
     local cur prev options tapes drives
     
     COMPREPLY=()
-    cur=${COMP_WORDS[COMP_CWORD]}
+    cur=`_get_cword`
     prev=${COMP_WORDS[COMP_CWORD-1]}
 
     options="-f nobarcode invert noattach --version inquiry noattach \
@@ -25,20 +26,17 @@ _mtx()
     if [ $COMP_CWORD -gt 1 ]; then
        case $prev in 
            load) 
-               COMPREPLY=( $( compgen -W "$tapes" -- $cur ) )          
+               COMPREPLY=( $( compgen -W "$tapes" -- "$cur" ) )
                ;;
-           unload|first|last|next)
-               COMPREPLY=( $( compgen -W "$drives" -- $cur ) )
-               ;;
-           -f)
-               true
+           @(unload|first|last|next))
+               COMPREPLY=( $( compgen -W "$drives" -- "$cur" ) )
                ;;
            *)
                true
                ;;
        esac
     else
-        COMPREPLY=( $( compgen -W "$options" -- $cur ) )
+        COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
     fi
     return 0
 } 
index db4c6fd7f5d8476fe159a7a61c9499ff3af821e7..448de175bab4787a77b44a16a0c031505aabd4ff 100644 (file)
@@ -1,3 +1,10 @@
+mtx (1.3.12-2) unstable; urgency=low
+
+  * patch from David Paleino to improve bash completions, closes: #522739
+  * switch to using dh_bash-completion
+
+ -- Bdale Garbee <bdale@gag.com>  Mon, 06 Apr 2009 10:20:08 -0600
+
 mtx (1.3.12-1) unstable; urgency=low
 
   * new upstream version, closes: #500590
index 9d73953c658a2699699352527f0b1ec7767b35db..cf4aa4c6c0c22e483314498a6683d76cb4e457f6 100755 (executable)
@@ -35,8 +35,6 @@ install: build
 
        make install bindir=`pwd`/debian/mtx/bin prefix=`pwd`/debian/mtx/usr \
                mandir=`pwd`/debian/mtx/usr/share/man
-       install -o root -g root -m 0644 debian/bash_completion \
-               debian/mtx/etc/bash_completion.d/mtx
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -49,7 +47,7 @@ binary-arch: build install
        dh_installexamples contrib/*
        dh_installmenu
        dh_installcron
-#      dh_installman
+       dh_bash-completion
        dh_installinfo
        dh_installchangelogs CHANGES
        dh_link