bash-completion: Fix/improve generator names extraction
This commit is contained in:
parent
351fd63ef5
commit
f85f6a5e79
|
@ -100,11 +100,13 @@ _cmake()
|
|||
return
|
||||
;;
|
||||
-G)
|
||||
# FIXME: doesn't work properly
|
||||
local IFS=$'\n'
|
||||
local quoted
|
||||
printf -v quoted %q "$cur"
|
||||
COMPREPLY=( $( compgen -W '$( cmake --help 2>/dev/null | sed -n \
|
||||
"/^.*[^ ].*= Generates/{s|^ *\(.*[^ ]\) *= Generates.*$|\1|;s| |\\\\ |g;p}" \
|
||||
2>/dev/null )' -- "$cur" ) )
|
||||
-e "1,/^Generators/d" \
|
||||
-e "/^ *[^ =]/{s|^ *\([^=]*[^ =]\).*$|\1|;s| |\\\\ |g;p}" \
|
||||
2>/dev/null )' -- "$quoted" ) )
|
||||
return
|
||||
;;
|
||||
--help-command)
|
||||
|
|
|
@ -8,8 +8,8 @@ _cpack()
|
|||
case "$prev" in
|
||||
-G)
|
||||
COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null |
|
||||
grep "^ .*= .*" 2> /dev/null | grep -v "^ -" 2>/dev/null |
|
||||
cut -d" " -f 3 )' -- "$cur" ) )
|
||||
sed -e "1,/^Generators/d" -e "s|^ *\([^ ]*\) .*$|\1|" \
|
||||
2>/dev/null )' -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
-C)
|
||||
|
|
Loading…
Reference in New Issue