File: bash-completion

package info (click to toggle)
dphys-swapfile 20100506-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 220 kB
  • sloc: sh: 424; makefile: 46
file content (24 lines) | stat: -rw-r--r-- 597 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## 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