slapt-src: Complete package versions for --build|--install options
This commit is contained in:
parent
1f50618715
commit
9cb6a1cd70
@ -89,7 +89,7 @@ have slapt-src &&
|
|||||||
_slapt_src()
|
_slapt_src()
|
||||||
{
|
{
|
||||||
local cur prev words cword
|
local cur prev words cword
|
||||||
_init_completion || return
|
_init_completion -n : || return
|
||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
--config|-c)
|
--config|-c)
|
||||||
@ -134,18 +134,15 @@ _slapt_src()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local builddir=$( sed -ne "/^BUILDDIR=/{s/^BUILDDIR=//;p}" "$config" )
|
if [[ "$cur" == *:* ]]; then
|
||||||
if [ ! -d "$builddir" ]; then
|
local name=${cur%:*}
|
||||||
return 0
|
local version=${cur##*:}
|
||||||
|
COMPREPLY=( $( slapt-src --config $config --search "^$name" 2> \
|
||||||
|
/dev/null | sed -ne "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}" ) )
|
||||||
|
else
|
||||||
|
COMPREPLY=( $( slapt-src --config $config --search "^$cur" 2>/dev/null \
|
||||||
|
| sed -ne "/^$cur/{s/ .*$//;p}" ) )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local slck_data="${builddir}/slackbuilds_data"
|
|
||||||
if [ ! -r "$slck_data" ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
COMPREPLY=( $( sed -ne \
|
|
||||||
"/^SLACKBUILD NAME: $cur/{s/^SLACKBUILD NAME: //;p}" "$slck_data" ) )
|
|
||||||
} && complete -F _slapt_src slapt-src
|
} && complete -F _slapt_src slapt-src
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user