mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 00:15:32 +00:00
- 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]
41 lines
1.3 KiB
Text
41 lines
1.3 KiB
Text
# shellcheck disable=SC2148
|
|
# No hashbang for bash completion scripts! They are intended to be sourced, not executed.
|
|
|
|
_km-package-uninstall_completions()
|
|
{
|
|
local cur prev opts
|
|
COMPREPLY=()
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
opts="-h --help -s --shared -v --verbose -vv --veryverbose --version"
|
|
|
|
if [[ ${cur} == -* ]] ; then
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
|
return 0
|
|
fi
|
|
|
|
if [[ "${#COMP_WORDS[@]}" != "2" ]]; then
|
|
if [[ ${prev} != -* ]]; then
|
|
return 0
|
|
fi
|
|
fi
|
|
|
|
words=""
|
|
shared=""
|
|
case "${prev}" in
|
|
"-s"|"--shared")
|
|
for file in /usr/local/share/keyman/*; do kbid="$(basename "${file}")"; shared="${shared} ${kbid}"; done
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "${shared}" -- "${cur}"))
|
|
;;
|
|
*)
|
|
# shellcheck disable=SC2231 # doesn't work with quotes
|
|
for file in ${XDG_DATA_HOME:-~/.local/share}/keyman/*; do kbid="$(basename "${file}")"; words="${words} ${kbid}"; done
|
|
# shellcheck disable=SC2207
|
|
COMPREPLY=($(compgen -W "${words}" -- "${cur}"))
|
|
;;
|
|
esac
|
|
}
|
|
|
|
complete -F _km-package-uninstall_completions km-package-uninstall
|