diff options
Diffstat (limited to 'completions/wol')
-rw-r--r-- | completions/wol | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/completions/wol b/completions/wol index 89a1a8ba..02030aba 100644 --- a/completions/wol +++ b/completions/wol @@ -1,12 +1,9 @@ -# wol(1) completion +# wol(1) completion -*- shell-script -*- -have wol && _wol() { - local cur prev split=false - COMPREPLY=() - _get_comp_words_by_ref -n : cur prev - _split_longopt && split=true + local cur prev words cword split + _init_completion -s -n : || return case $prev in -V|--version|--help|-p|--port|--passwd|-w|--wait) @@ -29,8 +26,8 @@ _wol() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version --verbose --wait --host - --port --file --passwd' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace return 0 fi @@ -38,10 +35,4 @@ _wol() } && complete -F _wol wol -# 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 |