59 lines
1.4 KiB
Bash
59 lines
1.4 KiB
Bash
# this was auto-generated by OpenSC/doc/tools/Makefile.am
|
|
_piv_tool()
|
|
{
|
|
COMPREPLY=()
|
|
local cur prev split=false
|
|
_get_comp_words_by_ref -n : cur prev
|
|
|
|
_split_longopt && split=true
|
|
|
|
opts=" --admin --cert --compresscert --genkey --in --key-slots-discovery --name --object --out --reader --send-apdu --serial --verbose --wait -A -C -G -O -Z -i -n -o -r -s -v -w "
|
|
|
|
if [ ${COMP_CWORD} -eq 1 ]; then
|
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
return 0
|
|
fi
|
|
|
|
case "${prev}" in
|
|
!*)
|
|
_filedir so
|
|
return 0
|
|
;;
|
|
!*)
|
|
_filedir
|
|
return 0
|
|
;;
|
|
!*|--password)
|
|
COMPREPLY=( $( compgen -W "$(printenv | cut -d = -f 1 | xargs printf 'env:%s ')" -- $cur ) )
|
|
__ltrim_colon_completions "$cur"
|
|
return 0
|
|
;;
|
|
--admin|--cert|--compresscert|--genkey|--in|--key-slots-discovery|--object|--out|--reader|--send-apdu|-A|-C|-G|-O|-Z|-i|-o|-r|-s)
|
|
return 0
|
|
;;
|
|
*)
|
|
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
|
return 0
|
|
;;
|
|
esac
|
|
|
|
$split && return 0
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
_longopt $1
|
|
return
|
|
fi
|
|
|
|
_filedir
|
|
}
|
|
complete -F _piv_tool piv-tool
|
|
|
|
|
|
# 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
|