aboutsummaryrefslogtreecommitdiffstats
path: root/completion/bash
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2013-08-03 01:23:32 +0100
committerJonathan McCrohan <jmccrohan@gmail.com>2013-08-03 01:23:32 +0100
commitcd2d89a4141e95875f075be2819e74d4eaa11657 (patch)
tree4c942c530b3567da7b479bb6573a781a3cd79513 /completion/bash
parent62656dc52892e267c59cfb3a9a66d644c5ae0e99 (diff)
parent7cd90128add168a27fc6e9b93756fbc0a3c65f8f (diff)
downloadtransmission-remote-cli-cd2d89a4141e95875f075be2819e74d4eaa11657.tar.gz
Merge tag 'upstream/1.6.1'
Upstream version 1.6.1
Diffstat (limited to 'completion/bash')
-rw-r--r--completion/bash/transmission-remote-cli-bash-completion.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/completion/bash/transmission-remote-cli-bash-completion.sh b/completion/bash/transmission-remote-cli-bash-completion.sh
new file mode 100644
index 0000000..1a0e30b
--- /dev/null
+++ b/completion/bash/transmission-remote-cli-bash-completion.sh
@@ -0,0 +1,31 @@
+# bash completion for transmission-remote-cli(1) -*- shell-script -*-
+
+_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
+
+# ex: ts=4 sw=4 et filetype=sh