#!/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