Add zsh completion support

Both bash and zsh completions could be supported using single file.
This commit is contained in:
Alexander Kapshuna
2020-09-12 18:08:31 +03:00
committed by borgmanJeremy
parent d72d1e6ad9
commit 23ae6c1579
3 changed files with 20 additions and 7 deletions

View File

@@ -1,5 +1,8 @@
# bash-completion for flameshot command
#compdef flameshot
# Shell completion for flameshot command
# To be installed in "/usr/share/bash-completion/completions/flameshot"
# and "/usr/share/zsh/site-functions/"
_flameshot() {
local prev cur cmd gui_opts full_opts config_opts
@@ -64,4 +67,10 @@ _flameshot() {
;;
esac
}
if [[ -n ${ZSH_VERSION} ]]; then
autoload -U bashcompinit
bashcompinit
fi
complete -F _flameshot flameshot