Open Tillerino opened 4 years ago
Quick and dirty draft:
_dive_completions()
{
local cur prev words cword
_init_completion -n : || return
case "$cur" in
-*)
COMPREPLY=( $( compgen -W '$(_parse_help "$1")' -- "$cur" ) )
;;
*)
COMPREPLY=( $(compgen -W "$(docker images --format '{{.Repository}}:{{.Tag}}')" -- "$cur") )
__ltrim_colon_completions "$cur"
;;
esac
}
complete -F _dive_completions dive
Generate completiom for Bash in Cobra: https://github.com/spf13/cobra/blob/master/bash_completions.md More details: https://github.com/spf13/cobra/blob/master/shell_completions.md
Zsh also.
Is there bash completion for dive? It would be really helpful for image names.