#compdef multipass _multipass_get_command_list () { # Sample output: # $ multipass --help # ... # Options: # -h, --help Display this help # -v, --verbose Increase logging verbosity. Repeat the 'v' in the short option # for more detail. Maximum verbosity is obtained with 4 (or more) # v's, i.e. -vvvv. # ... # Available commands: # alias Create an alias # aliases List available aliases # ... # $_comp_command1 --help | sed '1,/Available commands/d' | awk '/^[ \t]*[a-z]+/ { print $1 }' } _multipass_get_args_list () { # Sample output: # $ multpass help stop # ... # Options: # -h, --help Display this help # -v, --verbose Increase logging verbosity. Repeat the 'v' in the short # option for more detail. Maximum verbosity is obtained with # 4 (or more) v's, i.e. -vvvv. # --all Stop all instances # -t, --time