spiegel-keyman/linux/keyman-config/km-kvk2ldml.bash-completion
Eberhard Beilharz 5f5054b93c
chore(linux): Fix lintian warnings
- add rudimentary man page for keyman-system-service
- remove hashbang for bash completion files
- reword description for keyman-system-service

This fixes these lintian warnings:
keyman-system-service: description-is-pkg-name Keyman system service
keyman: bash-completion-with-hashbang /usr/bin/env bash
        [usr/share/bash-completion/completions/km-config:1]
keyman-system-service: no-manual-page
        [usr/libexec/keyman-system-service]
2023-06-05 17:18:55 +02:00

36 lines
985 B
Text

# shellcheck disable=SC2148
# No hashbang for bash completion scripts! They are intended to be sourced, not executed.
_km-kvk2ldml_completions()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-h --help -p --print -k --keys -o --output -v --verbose -vv --veryverbose --version"
if [[ ${cur} == -* ]] ; then
# shellcheck disable=SC2207
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
"-o"|"--output")
local IFS=$'\n'
compopt -o filenames
# shellcheck disable=SC2207
COMPREPLY=( $(compgen -f -- "$cur") )
return 0
;;
*)
;;
esac
local IFS=$'\n'
compopt -o filenames
# shellcheck disable=SC2207
COMPREPLY=( $(compgen -f -X "!"*.kvk -- "$cur") $(compgen -d -- "$cur") )
}
complete -F _km-kvk2ldml_completions km-kvk2ldml