Vendor dependencies with dep and commit vendor/

This commit is contained in:
Matthias Loibl 2018-04-28 16:12:36 +02:00
parent 2ef36da33a
commit 4c1f31f272
No known key found for this signature in database
GPG key ID: B1C7DF661ABB2C1A
38 changed files with 9490 additions and 0 deletions

33
vendor/gopkg.in/alecthomas/kingpin.v2/completions.go generated vendored Normal file
View file

@ -0,0 +1,33 @@
package kingpin
// HintAction is a function type who is expected to return a slice of possible
// command line arguments.
type HintAction func() []string
type completionsMixin struct {
hintActions []HintAction
builtinHintActions []HintAction
}
func (a *completionsMixin) addHintAction(action HintAction) {
a.hintActions = append(a.hintActions, action)
}
// Allow adding of HintActions which are added internally, ie, EnumVar
func (a *completionsMixin) addHintActionBuiltin(action HintAction) {
a.builtinHintActions = append(a.builtinHintActions, action)
}
func (a *completionsMixin) resolveCompletions() []string {
var hints []string
options := a.builtinHintActions
if len(a.hintActions) > 0 {
// User specified their own hintActions. Use those instead.
options = a.hintActions
}
for _, hintAction := range options {
hints = append(hints, hintAction()...)
}
return hints
}