From b9a5f508e2b2ed9e4a06b2adae254debcc4a749a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 29 Sep 2011 23:11:31 +0300 Subject: chrpath: New completion. --- completions/Makefile.am | 1 + completions/chrpath | 33 +++++++++++++++++++++++++++++++++ test/completion/chrpath.exp | 1 + test/lib/completions/chrpath.exp | 21 +++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 completions/chrpath create mode 100644 test/completion/chrpath.exp create mode 100644 test/lib/completions/chrpath.exp diff --git a/completions/Makefile.am b/completions/Makefile.am index a121a891..89d764e5 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -21,6 +21,7 @@ bashcomp_DATA = abook \ cardctl \ cfengine \ chkconfig \ + chrpath \ chsh \ cksfv \ clisp \ diff --git a/completions/chrpath b/completions/chrpath new file mode 100644 index 00000000..5d40203a --- /dev/null +++ b/completions/chrpath @@ -0,0 +1,33 @@ +have chrpath || return + +_chrpath() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -v|--version|-h|--help) + return + ;; + -r|--replace) + _filedir -d + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return + fi + + _filedir +} && +complete -F _chrpath chrpath + +# 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/chrpath.exp b/test/completion/chrpath.exp new file mode 100644 index 00000000..eee81ec7 --- /dev/null +++ b/test/completion/chrpath.exp @@ -0,0 +1 @@ +assert_source_completions chrpath diff --git a/test/lib/completions/chrpath.exp b/test/lib/completions/chrpath.exp new file mode 100644 index 00000000..311628eb --- /dev/null +++ b/test/lib/completions/chrpath.exp @@ -0,0 +1,21 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "chrpath " +sync_after_int + +assert_complete_any "chrpath -" +sync_after_int + + +teardown -- cgit v1.2.1