Package: dphys-swapfile
Version: 20061020-4
Severity: wishlist
Tags: patch

Please include the attached script in /etc/bash_completion.d/ in
the package.  It sets up bash completion for the dphys-swapfile
command, which I find very handy because it makes this script
self-documenting.

To install, edit or add a debian/install file and add this line:

dphys-swapfile etc/bash_completion.d/

-- System Information:
Debian Release: 6.0.5
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
## Bash completion for the Android SDK tools.
#
# Written by Hans-Christoph Steiner, 2012
#
# This work is too trival to have any copyright, I hereby wave any copyright
# and release it into the public domain.

function _dphys_swapfile()
{
  local cur prev opts
  COMPREPLY=()
  cur="${COMP_WORDS[COMP_CWORD]}"
  prev="${COMP_WORDS[COMP_CWORD-1]}"
  opts="setup swapon swapoff uninstall"

  if [ ${COMP_CWORD} -eq 1 ]; then
      COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
      return 0
  else  
      COMPREPLY=""
      return 0
  fi
}
complete -o default -F _dphys_swapfile dphys-swapfile

Reply via email to