]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/mitchellh/cli/cli.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / mitchellh / cli / cli.go
index a25a5822d1129440f2a90f3a9185226f7c7947a5..c2dbe55aa07fd92b4f0c00a8e9c8b1e26f37b5eb 100644 (file)
@@ -87,7 +87,7 @@ type CLI struct {
        // should be set exactly to the binary name that is autocompleted.
        //
        // Autocompletion is supported via the github.com/posener/complete
-       // library. This library supports both bash and zsh. To add support
+       // library. This library supports bash, zsh and fish. To add support
        // for other shells, please see that library.
        //
        // AutocompleteInstall and AutocompleteUninstall are the global flag
@@ -419,6 +419,11 @@ func (c *CLI) initAutocomplete() {
 func (c *CLI) initAutocompleteSub(prefix string) complete.Command {
        var cmd complete.Command
        walkFn := func(k string, raw interface{}) bool {
+               // Ignore the empty key which can be present for default commands.
+               if k == "" {
+                       return false
+               }
+
                // Keep track of the full key so that we can nest further if necessary
                fullKey := k