Skip to content

Commit

Permalink
Fix shell completion
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Mar 10, 2024
1 parent 986ddc2 commit 7127952
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions autocomplete/zsh_autocomplete
@@ -1,20 +1,16 @@
#compdef emu

_cli_zsh_autocomplete() {
local -a opts
local cur
cur=${words[-1]}
if [[ "$cur" == "-"* ]]; then
opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}")
else
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion)}")
fi
local -a opts
local cur
cur=${words[-1]}
if [[ "$cur" == "-"* ]]; then
opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion)}")
else
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion)}")
fi

if [[ "${opts[1]}" != "" ]]; then
_describe 'values' opts
else
_files
fi
}

compdef _cli_zsh_autocomplete emu
if [[ "${opts[1]}" != "" ]]; then
_describe 'values' opts
else
_files
fi

0 comments on commit 7127952

Please sign in to comment.