diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2011-09-29 22:57:59 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2011-09-29 22:57:59 +0300 |
commit | e1a3492261d0d9fed79d72cbe23839e7fb70f396 (patch) | |
tree | f717ff0ad7626df0baea0c0b9bed8231a0ebec5d | |
parent | 2014d3b45d0a3f7abbe494b5f4861d4e40e461be (diff) | |
download | bash-completion-e1a3492261d0d9fed79d72cbe23839e7fb70f396.tar.gz |
prelink: New completion.
-rw-r--r-- | completions/Makefile.am | 1 | ||||
-rw-r--r-- | completions/prelink | 48 | ||||
-rw-r--r-- | test/completion/prelink.exp | 1 | ||||
-rw-r--r-- | test/lib/completions/prelink.exp | 21 |
4 files changed, 71 insertions, 0 deletions
diff --git a/completions/Makefile.am b/completions/Makefile.am index ae792b07..a121a891 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -134,6 +134,7 @@ bashcomp_DATA = abook \ postfix \ postgresql \ povray \ + prelink \ procps \ protoc \ puppet \ diff --git a/completions/prelink b/completions/prelink new file mode 100644 index 00000000..017d543a --- /dev/null +++ b/completions/prelink @@ -0,0 +1,48 @@ +have prelink || return + +_prelink() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -'?'|--help|--usage|-V|--version|-r|--reloc-only) + return + ;; + -b|--black-list|--dynamic-linker|--undo-output) + _filedir + return + ;; + -c|--config-file) + _filedir conf + return + ;; + -C|--cache) + _filedir cache + return + ;; + --ld-library-path) + _filedir -d + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir +} && +complete -F _prelink prelink + +# 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/prelink.exp b/test/completion/prelink.exp new file mode 100644 index 00000000..d1fbb8ee --- /dev/null +++ b/test/completion/prelink.exp @@ -0,0 +1 @@ +assert_source_completions prelink diff --git a/test/lib/completions/prelink.exp b/test/lib/completions/prelink.exp new file mode 100644 index 00000000..4a493667 --- /dev/null +++ b/test/lib/completions/prelink.exp @@ -0,0 +1,21 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "prelink " +sync_after_int + +assert_complete_any "prelink -" +sync_after_int + + +teardown |