diff --git a/src/dropshell-completion.bash b/src/dropshell-completion.bash index 3c591f4..9c34fd7 100755 --- a/src/dropshell-completion.bash +++ b/src/dropshell-completion.bash @@ -9,15 +9,16 @@ _dropshell_completions() { # List of main commands opts="help version status servers templates autocomplete_list_servers autocomplete_list_services autocomplete_list_commands run install backup" + # add all commands to opts + local commands=($(dropshell autocomplete_list_commands)) + opts="${opts} ${commands[*]}" + # If we're completing the first argument, show all commands if [[ ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi - # Get available commands from dropshell - local commands=($(dropshell autocomplete_list_commands)) - # Command-specific completions case "${prev}" in status|templates|autocomplete_list_servers|autocomplete_list_services|autocomplete_list_commands)