From 882d527237c77cdc757672affa070bb1b150b778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 21 Jul 2012 13:05:15 +0300 Subject: [PATCH] mussh: New completion. --- completions/Makefile.am | 1 + completions/mussh | 52 ++++++++++++++++++++++++++++++++++ test/completion/mussh.exp | 1 + test/lib/completions/mussh.exp | 18 ++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 completions/mussh create mode 100644 test/completion/mussh.exp create mode 100644 test/lib/completions/mussh.exp diff --git a/completions/Makefile.am b/completions/Makefile.am index b6895d2c..02f239cc 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -208,6 +208,7 @@ bashcomp_DATA = a2x \ munin-node-configure \ munin-run \ munin-update \ + mussh \ mutt \ mysql \ mysqladmin \ diff --git a/completions/mussh b/completions/mussh new file mode 100644 index 00000000..a7bf2997 --- /dev/null +++ b/completions/mussh @@ -0,0 +1,52 @@ +# mussh(1) completion -*- shell-script -*- + +_mussh() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|-V|-m|-t) + return + ;; + -d) + COMPREPLY=( $( compgen -W '{0..2}' -- "$cur" ) ) + return + ;; + -v) + COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + return + ;; + -i|-H|-C) + _filedir + return + ;; + -o|-po) + _xfunc ssh _ssh_options + return + ;; + -l|-L) + COMPREPLY=( $( compgen -u -- "$cur" ) ) + return + ;; + -s) + _shells + return + ;; + -p|-h) + [[ $cur == *@* ]] && _user_at_host || _known_hosts_real -a "$cur" + return + ;; + -c) + compopt -o filenames + COMPREPLY+=( $( compgen -c -- "$cur" ) ) + return + ;; + esac + + [[ $cur != -* ]] || \ + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) +} && +complete -F _mussh mussh + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/mussh.exp b/test/completion/mussh.exp new file mode 100644 index 00000000..1232287c --- /dev/null +++ b/test/completion/mussh.exp @@ -0,0 +1 @@ +assert_source_completions mussh diff --git a/test/lib/completions/mussh.exp b/test/lib/completions/mussh.exp new file mode 100644 index 00000000..24c5c1f1 --- /dev/null +++ b/test/lib/completions/mussh.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "mussh -" +sync_after_int + + +teardown