Package: pmount
Version: 0.9.18-2
Severity: wishlist
Tags: patch

Hello,

I wrote a bash completion helper for /etc/bash_completion.d/ , please
consider including it into the package and sending upstream. See
attached file.

Regards,
Eduard.


-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.28 (SMP w/1 CPU core; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages pmount depends on:
ii  libblkid1                     1.41.3-1   block device id library
ii  libc6                         2.9-1      GNU C Library: Shared libraries
ii  libdbus-1-3                   1.2.12-1   simple interprocess messaging syst
ii  libhal-storage1               0.5.11-8   Hardware Abstraction Layer - share
ii  libhal1                       0.5.11-8   Hardware Abstraction Layer - share
ii  libsysfs2                     2.1.0-5    interface library to sysfs

pmount recommends no packages.

Versions of packages pmount suggests:
ii  cryptsetup                    2:1.0.6-7  configures encrypted block devices
ii  hal                           0.5.11-8   Hardware Abstraction Layer

-- no debconf information

-- 
Es begegnet mir von Zeit zu Zeit ein Jüngling, an dem ich nichts 
verändert noch gebessert wünschte; nur macht mir bange, dass ich 
manchen vollkommen geeignet sehe, im Zeitstrom mit fort zu schwimmen; 
und hier ist's, wo ich immerfort aufmerksam machen möchte, dass dem 
Menschen in seinem zerbrechlichen Kahn eben deshalb das Ruder in die 
Hand gegeben ist, damit er nicht der Willkür der Wellen, sondern dem 
Willen seiner Einsicht Folge leiste.
                -- Goethe, Maximen und Reflektionen, Nr. 49
#-*- mode: shell-script;-*-
#
# Bash Completion snippet for the pmount command
# Copyright (c) Eduard Bloch, 2009
#
# Supports most (all?) of the possible option sets of version 0.9.18 except of
# too many device/directory arguments, the charset search can also be improved
#
# Inputs:
#   $1 -- name of the command whose arguments are being completed
#   $2 -- word being completed
#   $3 -- word preceding the word being completed
#   $COMP_LINE  -- current command line
#   $COMP_PONT  -- cursor position
#   $COMP_WORDS -- array containing individual words in the current
#                  command line
#   $COMP_CWORD -- index into ${COMP_WORDS} of the word containing the
#                  current cursor position
# Output:
#   COMPREPLY array variable contains possible completions

have pmount &&
_pmount() {

   local cur prev options devices fslist

   options=' -r --read-only -w --read-write -s --sync -A --noatime -e --exec \
   -t filesystem --type filesystem -c charset --charset charset -u umask \
   --umask umask --dmask dmask --fmask fmask -p file --passphrase file \
   -h --help -d --debug -V --version'
   fslist=' ascii cp1250 cp1251 cp1255 cp437 cp737 cp775 cp850 cp852 cp855 
cp857 cp860 cp861 cp862 cp863 cp864 cp865 cp866 cp869 cp874 cp932 cp936 cp949 
cp950 euc-jp iso8859-1 iso8859-13 iso8859-14 iso8859-15 iso8859-2 iso8859-3 
iso8859-4 iso8859-5 iso8859-6 iso8859-7 iso8859-9 koi8-r koi8-ru koi8-u utf8'

   COMPREPLY=()
   cur=${COMP_WORDS[COMP_CWORD]}
   prev=${COMP_WORDS[COMP_CWORD-1]}

   case "$prev" in
      -@(t|-type))
      COMPREPLY=( $( grep "^[[:space:]]$cur" /proc/filesystems ) )
      return 0
      ;;

      -@(c|-charset))
      COMPREPLY=( $( compgen -W "$fslist" -- $cur ) )
      return 0
      ;;
      -@(u|d|-umask|-dmask))
      COMPREPLY=( ${cur}0 ${cur}1 ${cur}2 ${cur}3 ${cur}4 ${cur}5 ${cur}6 
${cur}7 )
      return 0
      ;;

      -@(p|-passphrase))
      _filedir
      return 0
      ;;

   esac

        if [[ "$cur" == -* ]]; then
                COMPREPLY=( $( compgen -W "$options" -- $cur ) )
        else
    devices="$( ls $(grep -v '^[[:space:]]*#' /etc/pmount.allow ) $(grep 1 
/sys/block/*/removable | sed -e 's,/sys/block/,/dev/,;s,/removable:1,*,') 
2>/dev/null | sort -u | sed -e 's,\(^/dev/\)\(.*\),\1\2 \2,' )"
                COMPREPLY=( $( compgen -W "$devices" -- $cur ) )
        fi

        return 0
}


have pumount &&
_pumount() {

   local cur prev options devices

   options=' -l --luks-force -h --help -d --debug --version'

   COMPREPLY=()
   cur=${COMP_WORDS[COMP_CWORD]}
   prev=${COMP_WORDS[COMP_CWORD-1]}


   if [[ "$cur" == -* ]]; then
      COMPREPLY=( $( compgen -W "$options" -- $cur ) )
   else
      devices="$( grep '/media/' /proc/mounts  | sed -e 's,.*/media/,,;s,\ 
.*,,;s,\(.*\),\1 /dev/\1,' )"
      COMPREPLY=( $( compgen -W "$devices" -- $cur ) )
   fi

   return 0
}

[ "$have" ] && complete -F _pmount $filenames pmount
[ "$have" ] && complete -F _pumount $filenames pumount

Reply via email to