Open tuukkamustonen opened 6 years ago
the jira
autocompletion for bash/zsh is available because of a Go library named "kingping" that we use: https://github.com/alecthomas/kingpin/tree/v2.2.6#bashzsh-shell-completion
They do not support fish, sending them a PR to support fish would be required currently.
Add this file to your ~/.config/fish/completions/jira.fish
function __jira_perform_completion
# echo "Performing completion"
set -l args (commandline -opc)
# echo (string escape -- (commandline -ct))
set -l commands 0
for subcommand in ("$args" --help)
# echo "Checking $subcommand"
if test "$subcommand" = "Commands:"
set commands 1
else if test "$commands" -eq 1
# echo "Found command $subcommand"
set -l parts (string split -m 1 ":" $subcommand)
set -l subcommand (string trim $parts[1])
set -l help (string trim $parts[2])
if not contains "$subcommand" help version
complete --command jira --exclusive --arguments $subcommand --condition __fish_use_subcommand --description "$help"
end
end
end
end
function __jira_prepare_completions
__jira_perform_completion
end
# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c jira -e
# The call to __jira_prepare_completions will setup __jira_comp_results
# which provides the program's completion choices.
__jira_prepare_completions
With
bash
andzsh
already supported, maybe adding support for fish, too, wouldn't hurt.