# Bash completion script for QOwnNotes
_QOwnNotes() {
COMPREPLY=()
local current="${COMP_WORDS[COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"
_init_completion || return
local commands="--h --help --portable --dump-settings --version --allow-multiple-instances --clear-settings --session --action --completion --decrypt-note --decrypt-note-password "
if [[ "$prev" == "--decrypt-note" ]]; then
compopt -o filenames
_filedir
return 0
fi
if [[ "$prev" == "--decrypt-note-password" ]]; then
return 0
fi
if [[ "$prev" == "--session" ]]; then
return 0
fi
if [[ "$prev" == "--action" ]]; then
return 0
fi
if [[ "$prev" == "--completion" ]]; then
COMPREPLY=( $(compgen -W "bash fish" -- "$current") )
return 0
fi
COMPREPLY=( $(compgen -W "${commands}" -- ${current}) )
return 0
}
complete -F _QOwnNotes QOwnNotes