conf-10-check-nrpe/conf/common/etc/bash_completion.d/check_conf

26 lines
692 B
Plaintext
Raw Normal View History

2021-02-21 18:40:30 +01:00
#!/usr/bin/env bash
# !! GIT FILE !!
# https://framagit.org/zorval/scripts/check-nrpe
_check_conf() {
local cur prev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
if [[ "$cur" == -* ]]; then
if [[ "$prev" == --copy-repo-to-local ]] || [[ "$prev" == --copy-local-to-repo ]]; then
COMPREPLY=( $(compgen -W "--force" -- "$cur") )
else
COMPREPLY=( $(compgen -W "--copy-repo-to-local --copy-local-to-repo" -- "$cur") )
fi
return 0
fi
COMPREPLY=( $(compgen -W "--copy-repo-to-local --copy-local-to-repo --force" -- "$cur") )
return 0
}
complete -F _check_conf check_conf