d72324ddf5
This generates the scripts that lets bash do completion per specific tool. It gets the options from the documentation XML files that are also the source for the man pages and HTML.
46 lines
831 B
Bash
46 lines
831 B
Bash
# this was auto-generated by OpenSC/doc/tools/Makefile.am
|
|
_FUNCTION_NAME()
|
|
{
|
|
COMPREPLY=()
|
|
local cur prev split=false
|
|
_get_comp_words_by_ref cur prev
|
|
|
|
_split_longopt && split=true
|
|
|
|
opts="ALLOPTS"
|
|
|
|
if [ ${COMP_CWORD} -eq 1 ]; then
|
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
return 0
|
|
fi
|
|
|
|
case "${prev}" in
|
|
OPTSWITHARGS)
|
|
return 0
|
|
;;
|
|
*)
|
|
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
|
return 0
|
|
;;
|
|
esac
|
|
|
|
$split && return 0
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
_longopt $1
|
|
return
|
|
fi
|
|
|
|
_filedir
|
|
}
|
|
complete -F _FUNCTION_NAME PROGRAM_NAME
|
|
|
|
|
|
# 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
|