You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.7 KiB
62 lines
1.7 KiB
# bash completion for cpack(1) -*- shell-script -*-
|
|
|
|
_cpack()
|
|
{
|
|
local cur prev words cword
|
|
_init_completion -n = || return
|
|
|
|
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" ) )
|
|
return
|
|
;;
|
|
-C)
|
|
COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
|
|
MinSizeRel' -- "$cur" ) )
|
|
return
|
|
;;
|
|
-D)
|
|
[[ $cur == *=* ]] && return # no completion for values
|
|
COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
|
|
2>/dev/null | tail -n +2 )' -S = -- "$cur" ) )
|
|
compopt -o nospace
|
|
return
|
|
;;
|
|
-P|-R|--vendor)
|
|
# argument required but no completions available
|
|
return
|
|
;;
|
|
-B)
|
|
_filedir -d
|
|
return
|
|
;;
|
|
--config)
|
|
_filedir
|
|
return
|
|
;;
|
|
--help-command)
|
|
COMPREPLY=( $( compgen -W '$( cpack --help-command-list 2>/dev/null|
|
|
tail -n +2 )' -- "$cur" ) )
|
|
return
|
|
;;
|
|
--help-variable)
|
|
COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
|
|
2>/dev/null | tail -n +2 )' -- "$cur" ) )
|
|
return
|
|
;;
|
|
esac
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
|
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
|
[[ $COMPREPLY ]] && return
|
|
fi
|
|
|
|
_filedir
|
|
} &&
|
|
complete -F _cpack cpack
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|