Permalink
Browse files

Add bash completion file

  • Loading branch information...
1 parent 477a419 commit 9e15d540929008880f372a82a7c6ee1f44287cca Anton Larionov committed May 13, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 transmission-remote-cli-bash-completion.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+_transmission-remote-cli.py () {
+ local cur prev opts
+
+ _get_comp_words_by_ref cur prev
+
+ opts="--version -h --help -c --connect= -s --ssl -f --config= --create-config -n --netrc --debug"
+
+ if [[ ${cur} == -* ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ else
+ _filedir torrent
+ fi
+}
+
+complete -F _transmission-remote-cli.py transmission-remote-cli.py

3 comments on commit 9e15d54

Owner

fagga replied May 24, 2012

I'm getting the following error if I simply source this file in bash 4.2.20 and then try to complete anything.

bash: _get_comp_words_by_ref: command not found
bash: _filedir: command not found

bash-completion version is 1.99-3 (Debian testing).

Any ideas?

Contributor

diffycat replied May 24, 2012

I'm using Arch Linux, bash 4.2.028 and bash-completion 1.99.

Are you sure bash-completion is working? (e.g. try killall command).

Try this:
source /usr/share/bash-completion/bash_completion && source transmission-remote-cli-bash-completion.sh

Owner

fagga replied May 24, 2012

Please sign in to comment.