diff options
Diffstat (limited to 'vendor/github.com/mitchellh/cli')
-rw-r--r-- | vendor/github.com/mitchellh/cli/.travis.yml | 5 | ||||
-rw-r--r-- | vendor/github.com/mitchellh/cli/cli.go | 7 | ||||
-rw-r--r-- | vendor/github.com/mitchellh/cli/go.mod | 12 | ||||
-rw-r--r-- | vendor/github.com/mitchellh/cli/go.sum | 22 | ||||
-rw-r--r-- | vendor/github.com/mitchellh/cli/ui_colored.go | 32 |
5 files changed, 61 insertions, 17 deletions
diff --git a/vendor/github.com/mitchellh/cli/.travis.yml b/vendor/github.com/mitchellh/cli/.travis.yml index 974234b..b8599b3 100644 --- a/vendor/github.com/mitchellh/cli/.travis.yml +++ b/vendor/github.com/mitchellh/cli/.travis.yml | |||
@@ -3,8 +3,9 @@ sudo: false | |||
3 | language: go | 3 | language: go |
4 | 4 | ||
5 | go: | 5 | go: |
6 | - 1.8 | 6 | - "1.8" |
7 | - 1.9 | 7 | - "1.9" |
8 | - "1.10" | ||
8 | 9 | ||
9 | branches: | 10 | branches: |
10 | only: | 11 | only: |
diff --git a/vendor/github.com/mitchellh/cli/cli.go b/vendor/github.com/mitchellh/cli/cli.go index a25a582..c2dbe55 100644 --- a/vendor/github.com/mitchellh/cli/cli.go +++ b/vendor/github.com/mitchellh/cli/cli.go | |||
@@ -87,7 +87,7 @@ type CLI struct { | |||
87 | // should be set exactly to the binary name that is autocompleted. | 87 | // should be set exactly to the binary name that is autocompleted. |
88 | // | 88 | // |
89 | // Autocompletion is supported via the github.com/posener/complete | 89 | // Autocompletion is supported via the github.com/posener/complete |
90 | // library. This library supports both bash and zsh. To add support | 90 | // library. This library supports bash, zsh and fish. To add support |
91 | // for other shells, please see that library. | 91 | // for other shells, please see that library. |
92 | // | 92 | // |
93 | // AutocompleteInstall and AutocompleteUninstall are the global flag | 93 | // AutocompleteInstall and AutocompleteUninstall are the global flag |
@@ -419,6 +419,11 @@ func (c *CLI) initAutocomplete() { | |||
419 | func (c *CLI) initAutocompleteSub(prefix string) complete.Command { | 419 | func (c *CLI) initAutocompleteSub(prefix string) complete.Command { |
420 | var cmd complete.Command | 420 | var cmd complete.Command |
421 | walkFn := func(k string, raw interface{}) bool { | 421 | walkFn := func(k string, raw interface{}) bool { |
422 | // Ignore the empty key which can be present for default commands. | ||
423 | if k == "" { | ||
424 | return false | ||
425 | } | ||
426 | |||
422 | // Keep track of the full key so that we can nest further if necessary | 427 | // Keep track of the full key so that we can nest further if necessary |
423 | fullKey := k | 428 | fullKey := k |
424 | 429 | ||
diff --git a/vendor/github.com/mitchellh/cli/go.mod b/vendor/github.com/mitchellh/cli/go.mod new file mode 100644 index 0000000..675325f --- /dev/null +++ b/vendor/github.com/mitchellh/cli/go.mod | |||
@@ -0,0 +1,12 @@ | |||
1 | module github.com/mitchellh/cli | ||
2 | |||
3 | require ( | ||
4 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 | ||
5 | github.com/bgentry/speakeasy v0.1.0 | ||
6 | github.com/fatih/color v1.7.0 | ||
7 | github.com/hashicorp/go-multierror v1.0.0 // indirect | ||
8 | github.com/mattn/go-colorable v0.0.9 // indirect | ||
9 | github.com/mattn/go-isatty v0.0.3 | ||
10 | github.com/posener/complete v1.1.1 | ||
11 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc // indirect | ||
12 | ) | ||
diff --git a/vendor/github.com/mitchellh/cli/go.sum b/vendor/github.com/mitchellh/cli/go.sum new file mode 100644 index 0000000..0370875 --- /dev/null +++ b/vendor/github.com/mitchellh/cli/go.sum | |||
@@ -0,0 +1,22 @@ | |||
1 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= | ||
2 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= | ||
3 | github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= | ||
4 | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= | ||
5 | github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= | ||
6 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= | ||
7 | github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357 h1:Rem2+U35z1QtPQc6r+WolF7yXiefXqDKyk+lN2pE164= | ||
8 | github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= | ||
9 | github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= | ||
10 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= | ||
11 | github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0 h1:j30noezaCfvNLcdMYSvHLv81DxYRSt1grlpseG67vhU= | ||
12 | github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= | ||
13 | github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= | ||
14 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= | ||
15 | github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= | ||
16 | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= | ||
17 | github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= | ||
18 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= | ||
19 | github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= | ||
20 | github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= | ||
21 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc h1:MeuS1UDyZyFH++6vVy44PuufTeFF0d0nfI6XB87YGSk= | ||
22 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
diff --git a/vendor/github.com/mitchellh/cli/ui_colored.go b/vendor/github.com/mitchellh/cli/ui_colored.go index e3d5131..b0ec448 100644 --- a/vendor/github.com/mitchellh/cli/ui_colored.go +++ b/vendor/github.com/mitchellh/cli/ui_colored.go | |||
@@ -1,7 +1,11 @@ | |||
1 | package cli | 1 | package cli |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "github.com/fatih/color" |
5 | ) | ||
6 | |||
7 | const ( | ||
8 | noColor = -1 | ||
5 | ) | 9 | ) |
6 | 10 | ||
7 | // UiColor is a posix shell color code to use. | 11 | // UiColor is a posix shell color code to use. |
@@ -12,13 +16,13 @@ type UiColor struct { | |||
12 | 16 | ||
13 | // A list of colors that are useful. These are all non-bolded by default. | 17 | // A list of colors that are useful. These are all non-bolded by default. |
14 | var ( | 18 | var ( |
15 | UiColorNone UiColor = UiColor{-1, false} | 19 | UiColorNone UiColor = UiColor{noColor, false} |
16 | UiColorRed = UiColor{31, false} | 20 | UiColorRed = UiColor{int(color.FgHiRed), false} |
17 | UiColorGreen = UiColor{32, false} | 21 | UiColorGreen = UiColor{int(color.FgHiGreen), false} |
18 | UiColorYellow = UiColor{33, false} | 22 | UiColorYellow = UiColor{int(color.FgHiYellow), false} |
19 | UiColorBlue = UiColor{34, false} | 23 | UiColorBlue = UiColor{int(color.FgHiBlue), false} |
20 | UiColorMagenta = UiColor{35, false} | 24 | UiColorMagenta = UiColor{int(color.FgHiMagenta), false} |
21 | UiColorCyan = UiColor{36, false} | 25 | UiColorCyan = UiColor{int(color.FgHiCyan), false} |
22 | ) | 26 | ) |
23 | 27 | ||
24 | // ColoredUi is a Ui implementation that colors its output according | 28 | // ColoredUi is a Ui implementation that colors its output according |
@@ -55,15 +59,15 @@ func (u *ColoredUi) Warn(message string) { | |||
55 | u.Ui.Warn(u.colorize(message, u.WarnColor)) | 59 | u.Ui.Warn(u.colorize(message, u.WarnColor)) |
56 | } | 60 | } |
57 | 61 | ||
58 | func (u *ColoredUi) colorize(message string, color UiColor) string { | 62 | func (u *ColoredUi) colorize(message string, uc UiColor) string { |
59 | if color.Code == -1 { | 63 | if uc.Code == noColor { |
60 | return message | 64 | return message |
61 | } | 65 | } |
62 | 66 | ||
63 | attr := 0 | 67 | attr := []color.Attribute{color.Attribute(uc.Code)} |
64 | if color.Bold { | 68 | if uc.Bold { |
65 | attr = 1 | 69 | attr = append(attr, color.Bold) |
66 | } | 70 | } |
67 | 71 | ||
68 | return fmt.Sprintf("\033[%d;%dm%s\033[0m", attr, color.Code, message) | 72 | return color.New(attr...).SprintFunc()(message) |
69 | } | 73 | } |