slapt-src: split options from their arguments

This commit is contained in:
Igor Murzov 2014-06-05 00:49:17 +04:00
parent 8566a5a896
commit 3a65be4a18

View File

@ -2,8 +2,8 @@
_slapt_src() _slapt_src()
{ {
local cur prev words cword local cur prev words cword split
_init_completion -n : || return _init_completion -s -n : || return
case "$prev" in case "$prev" in
--config|-c) --config|-c)
@ -16,6 +16,8 @@ _slapt_src()
;; ;;
esac esac
$split && return
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace [[ $COMPREPLY == *= ]] && compopt -o nospace