1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 11:02:41 +03:00

Mod: Added flaggy to vendor directory

Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
This commit is contained in:
Glenn Vriesman
2019-09-24 18:52:52 +02:00
parent 431f1aa766
commit d8a6f173c3
14 changed files with 2347 additions and 0 deletions

29
vendor/github.com/integrii/flaggy/argumentParser.go generated vendored Normal file
View File

@@ -0,0 +1,29 @@
package flaggy
// setValueForParsers sets the value for a specified key in the
// specified parsers (which normally include a Parser and Subcommand).
// The return values represent the key being set, and any errors
// returned when setting the key, such as failures to convert the string
// into the appropriate flag value. We stop assigning values as soon
// as we find a parser that accepts it.
func setValueForParsers(key string, value string, parsers ...ArgumentParser) (bool, error) {
var valueWasSet bool
for _, p := range parsers {
valueWasSet, err := p.SetValueForKey(key, value)
if err != nil {
return valueWasSet, err
}
if valueWasSet {
break
}
}
return valueWasSet, nil
}
// ArgumentParser represents a parser or subcommand
type ArgumentParser interface {
SetValueForKey(key string, value string) (bool, error)
}