[Bash-completion-commits] [SCM] bash-completion branch, master, updated. a3ae00956daceceda9a1f44f955b35fa110b33fa

Guillaume Rousse Guillaume.Rousse at inria.fr
Sun Sep 12 09:38:52 UTC 2010


The following commit has been merged in the master branch:
commit a3ae00956daceceda9a1f44f955b35fa110b33fa
Author: Guillaume Rousse <Guillaume.Rousse at inria.fr>
Date:   Sun Sep 12 11:37:58 2010 +0200

    add freerdp completion

diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index ea129d0..b3aea2d 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -37,6 +37,7 @@ static_bashcomp = abook \
 		dsniff \
 		findutils \
 		freeciv \
+		freerdp \
 		fuse \
 		gcc \
 		gcl \
diff --git a/contrib/freerdp b/contrib/freerdp
new file mode 100644
index 0000000..82a4646
--- /dev/null
+++ b/contrib/freerdp
@@ -0,0 +1,47 @@
+# bash completion for xfreerdp
+
+have xfreerdp &&
+_xfreerdp()
+{
+    local cur prev
+
+    COMPREPLY=()
+    _get_comp_words_by_ref cur prev
+
+    case $prev in
+        -k)
+            COMPREPLY=( $( compgen -W "$(xfreerdp --kbd-list | \
+		    awk '/^0x/ {print $1}')" -- "$cur" ) )
+            return 0
+            ;;
+        -a)
+            COMPREPLY=( $( compgen -W '8 15 16 24 32' -- "$cur" ) )
+            return 0
+            ;;
+        -x)
+            COMPREPLY=( $( compgen -W 'b broadband m modem l lan' -- $cur ) )
+            return 0
+            ;;
+        --plugin)
+            COMPREPLY=( $( compgen -W 'cliprdr rdpsnd rdpdr' -- "$cur" ) )
+            return 0
+            ;;
+    esac
+
+    if [[ "$cur" == -* ]]; then
+        COMPREPLY=( $( compgen -W '-u -d -s -c -p -n -t -g -a -z -f -x -O -o \
+            -k --kbd-list -h --plugin --data' -- "$cur" ) )
+    else
+        _known_hosts_real "$cur"
+    fi
+
+} &&
+complete -F _xfreerdp xfreerdp
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/freerdp.exp b/test/completion/freerdp.exp
new file mode 100644
index 0000000..5ca649a
--- /dev/null
+++ b/test/completion/freerdp.exp
@@ -0,0 +1 @@
+assert_source_completions xfreerdp
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/freerdp.exp
similarity index 79%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/freerdp.exp
index 12314d7..be61d45 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/freerdp.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "animate "
+assert_complete_any "xfreerdp"
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list