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

42
vendor/gopkg.in/alecthomas/kingpin.v2/actions.go generated vendored Normal file
View file

@ -0,0 +1,42 @@
package kingpin
// Action callback executed at various stages after all values are populated.
// The application, commands, arguments and flags all have corresponding
// actions.
type Action func(*ParseContext) error
type actionMixin struct {
actions []Action
preActions []Action
}
type actionApplier interface {
applyActions(*ParseContext) error
applyPreActions(*ParseContext) error
}
func (a *actionMixin) addAction(action Action) {
a.actions = append(a.actions, action)
}
func (a *actionMixin) addPreAction(action Action) {
a.preActions = append(a.preActions, action)
}
func (a *actionMixin) applyActions(context *ParseContext) error {
for _, action := range a.actions {
if err := action(context); err != nil {
return err
}
}
return nil
}
func (a *actionMixin) applyPreActions(context *ParseContext) error {
for _, preAction := range a.preActions {
if err := preAction(context); err != nil {
return err
}
}
return nil
}