summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-09-29 23:11:31 +0300
committerVille Skyttä <ville.skytta@iki.fi>2011-09-29 23:11:31 +0300
commitb9a5f508e2b2ed9e4a06b2adae254debcc4a749a (patch)
tree982d05bcb5971dda8b68b8915b36eaf9e1a7b02e
parente1a3492261d0d9fed79d72cbe23839e7fb70f396 (diff)
downloadbash-completion-b9a5f508e2b2ed9e4a06b2adae254debcc4a749a.tar.gz
chrpath: New completion.
-rw-r--r--completions/Makefile.am1
-rw-r--r--completions/chrpath33
-rw-r--r--test/completion/chrpath.exp1
-rw-r--r--test/lib/completions/chrpath.exp21
4 files changed, 56 insertions, 0 deletions
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