- create libdvb2, possibly merging util/lib/* t='cgit v1.2.3'/>
aboutsummaryrefslogtreecommitdiffstats
path: root/transmission-remote-cli-bash-completion.sh
blob: 53e7f362efc8370be24764b181e43c07b3d66cda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

_transmission-remote-cli () {
  local cur prev opts

  _get_comp_words_by_ref cur prev

  opts="-h --help -v --version -c --connect -s --ssl -f --config --create-config -n --netrc --debug"

  if [[ ${cur} == -* ]] ; then
    COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
  else
    case "${prev}" in
      -c|--connect)
        # no completion, wait for user input
        ;;
      -f|--config)
        # dirs and files
        _filedir
        ;;
      *)
        # dirs and torrents
        _filedir torrent
        ;;
    esac
  fi
}

complete -F _transmission-remote-cli transmission-remote-cli