tribuchet: building on jamie === Testing bash completion === _cntr is a function _cntr () { local cur prev words cword; _init_completion || return; local subcommands="attach exec help version"; local common_opts="-t --type --apparmor -h --help -V --version"; local attach_opts="--effective-user"; local subcommand=""; local i; for ((i = 1; i < cword; i++)) do case "${words[i]}" in attach | exec | help | version) subcommand="${words[i]}"; break ;; esac; done; case "$subcommand" in attach) case "$prev" in -t | --type) COMPREPLY=($(compgen -W "$(_cntr_container_types)" -- "$cur")); return ;; --apparmor) COMPREPLY=($(compgen -W "$(_cntr_apparmor_modes)" -- "$cur")); return ;; --effective-user) COMPREPLY=($(compgen -u -- "$cur")); return ;; esac; if [[ "$cur" == -* ]]; then COMPREPLY=($(compgen -W "$common_opts $attach_opts" -- "$cur")); else COMPREPLY=($(compgen -W "$(_cntr_containers)" -- "$cur")); fi ;; exec) case "$prev" in -t | --type) COMPREPLY=($(compgen -W "$(_cntr_container_types)" -- "$cur")); return ;; --apparmor) COMPREPLY=($(compgen -W "$(_cntr_apparmor_modes)" -- "$cur")); return ;; esac; if [[ "$cur" == -* ]]; then COMPREPLY=($(compgen -W "$common_opts" -- "$cur")); else COMPREPLY=($(compgen -W "$(_cntr_containers)" -- "$cur")); fi ;; help | version) ;; *) COMPREPLY=($(compgen -W "$subcommands" -- "$cur")) ;; esac } Bash completions: attach exec help version === Testing zsh completion === _arguments:comparguments:327: can only be called from completion function === Testing fish completion === === Testing nushell completion === true