diff options
author | Igor Murzov <e-mail@date.by> | 2011-11-15 23:46:25 +0300 |
---|---|---|
committer | Igor Murzov <e-mail@date.by> | 2011-11-16 01:56:07 +0300 |
commit | 9ab064fb1785d828b6d93a27b9326b6ba156ecaa (patch) | |
tree | ced0ceb48bd3638bbc336e0fa5220d100531cc1e | |
parent | 6843989baf47e80218d89ee86b7f699c90e73be0 (diff) | |
download | bash-completion-9ab064fb1785d828b6d93a27b9326b6ba156ecaa.tar.gz |
pidof: Don't check OS type (Alioth #311403)
Also drop non-existent option arguments completion.
Reviewed-by: Ville Skyttä <ville.skytta@iki.fi>
-rw-r--r-- | completions/.gitignore | 1 | ||||
-rw-r--r-- | completions/Makefile.am | 6 | ||||
-rw-r--r-- | completions/pgrep | 3 | ||||
-rw-r--r-- | completions/pidof | 19 | ||||
-rw-r--r-- | test/completion/pidof.exp | 1 | ||||
-rw-r--r-- | test/lib/completions/pidof.exp | 20 |
6 files changed, 41 insertions, 9 deletions
diff --git a/completions/.gitignore b/completions/.gitignore index 427fdff6..9ce8b5a4 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -94,7 +94,6 @@ pbzip2 pccardctl perldoc phing -pidof pigz pinfo ping6 diff --git a/completions/Makefile.am b/completions/Makefile.am index 1ff35ee7..66f0eeb9 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -210,6 +210,7 @@ bashcomp_DATA = a2x \ passwd \ perl \ pgrep \ + pidof \ pine \ ping \ pkg-config \ @@ -425,7 +426,6 @@ CLEANFILES = \ pccardctl \ perldoc \ phing \ - pidof \ pigz \ pinfo \ ping6 \ @@ -683,10 +683,6 @@ symlinks: rm -f $(targetdir)/$$file && \ $(LN_S) perl $(targetdir)/$$file ; \ done - for file in pidof ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pgrep $(targetdir)/$$file ; \ - done for file in alpine ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) pine $(targetdir)/$$file ; \ diff --git a/completions/pgrep b/completions/pgrep index 9e66fb95..87df1a1f 100644 --- a/completions/pgrep +++ b/completions/pgrep @@ -32,7 +32,4 @@ _pgrep() } && complete -F _pgrep pgrep -# Linux pidof(8) completion. -[[ $OSTYPE == *linux* ]] && complete -F _pgrep pidof - # ex: ts=4 sw=4 et filetype=sh diff --git a/completions/pidof b/completions/pidof new file mode 100644 index 00000000..12ac9a79 --- /dev/null +++ b/completions/pidof @@ -0,0 +1,19 @@ +# pidof(8) completion -*- shell-script -*- + +_pidof() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -o) + _pids + return + ;; + esac + + _pnames +} && +complete -F _pidof pidof + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/pidof.exp b/test/completion/pidof.exp new file mode 100644 index 00000000..c66ee9f9 --- /dev/null +++ b/test/completion/pidof.exp @@ -0,0 +1 @@ +assert_source_completions pidof diff --git a/test/lib/completions/pidof.exp b/test/lib/completions/pidof.exp new file mode 100644 index 00000000..8fdab978 --- /dev/null +++ b/test/lib/completions/pidof.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "pidof " + + +sync_after_int + + +teardown |