mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 09:15:26 +01:00 
			
		
		
		
	Update Vendors: (#129)
* github.com/araddon/dateparse upgrade => v0.0.0-20200409225146-d820a6159ab1 * code.gitea.io/sdk/gitea upgrade => v0.11.3 * github.com/olekukonko/tablewriter upgrade => v0.0.4 * github.com/mattn/go-runewidth upgrade => v0.0.9 * github.com/stretchr/testify upgrade => v1.5.1 * github.com/davecgh/go-spew upgrade => v1.1.1 * github.com/urfave/cli/v2 upgrade => v2.2.0 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/129 Reviewed-by: techknowlogick <techknowlogick@gitea.io> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/.gitignore
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/.gitignore
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -3,3 +3,5 @@ | ||||
| node_modules/ | ||||
| vendor | ||||
| .idea | ||||
| internal/*/built-example | ||||
| coverage.txt | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,8 +1,6 @@ | ||||
| cli | ||||
| === | ||||
|  | ||||
| [](https://ci.appveyor.com/project/urfave/cli) | ||||
|  | ||||
| [](https://godoc.org/github.com/urfave/cli) | ||||
| [](https://codebeat.co/projects/github-com-urfave-cli) | ||||
| [](https://goreportcard.com/report/urfave/cli) | ||||
|   | ||||
							
								
								
									
										32
									
								
								vendor/github.com/urfave/cli/v2/app.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								vendor/github.com/urfave/cli/v2/app.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -7,7 +7,6 @@ import ( | ||||
| 	"io" | ||||
| 	"os" | ||||
| 	"path/filepath" | ||||
| 	"reflect" | ||||
| 	"sort" | ||||
| 	"time" | ||||
| ) | ||||
| @@ -44,8 +43,11 @@ type App struct { | ||||
| 	Flags []Flag | ||||
| 	// Boolean to enable bash completion commands | ||||
| 	EnableBashCompletion bool | ||||
| 	// Boolean to hide built-in help command | ||||
| 	// Boolean to hide built-in help command and help flag | ||||
| 	HideHelp bool | ||||
| 	// Boolean to hide built-in help command but keep help flag. | ||||
| 	// Ignored if HideHelp is true. | ||||
| 	HideHelpCommand bool | ||||
| 	// Boolean to hide built-in version flag and the VERSION section of help | ||||
| 	HideVersion bool | ||||
| 	// categories contains the categorized commands and is populated on app startup | ||||
| @@ -171,7 +173,9 @@ func (a *App) Setup() { | ||||
| 	a.Commands = newCommands | ||||
|  | ||||
| 	if a.Command(helpCommand.Name) == nil && !a.HideHelp { | ||||
| 		a.appendCommand(helpCommand) | ||||
| 		if !a.HideHelpCommand { | ||||
| 			a.appendCommand(helpCommand) | ||||
| 		} | ||||
|  | ||||
| 		if HelpFlag != nil { | ||||
| 			a.appendFlag(HelpFlag) | ||||
| @@ -329,19 +333,9 @@ func (a *App) RunAndExitOnError() { | ||||
| // RunAsSubcommand invokes the subcommand given the context, parses ctx.Args() to | ||||
| // generate command-specific flags | ||||
| func (a *App) RunAsSubcommand(ctx *Context) (err error) { | ||||
| 	// Setup also handles HideHelp and HideHelpCommand | ||||
| 	a.Setup() | ||||
|  | ||||
| 	// append help to commands | ||||
| 	if len(a.Commands) > 0 { | ||||
| 		if a.Command(helpCommand.Name) == nil && !a.HideHelp { | ||||
| 			a.appendCommand(helpCommand) | ||||
|  | ||||
| 			if HelpFlag != nil { | ||||
| 				a.appendFlag(HelpFlag) | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	var newCmds []*Command | ||||
| 	for _, c := range a.Commands { | ||||
| 		if c.HelpName == "" { | ||||
| @@ -485,16 +479,6 @@ func (a *App) VisibleFlags() []Flag { | ||||
| 	return visibleFlags(a.Flags) | ||||
| } | ||||
|  | ||||
| func (a *App) hasFlag(flag Flag) bool { | ||||
| 	for _, f := range a.Flags { | ||||
| 		if reflect.DeepEqual(flag, f) { | ||||
| 			return true | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| func (a *App) errWriter() io.Writer { | ||||
| 	// When the app ErrWriter is nil use the package level one. | ||||
| 	if a.ErrWriter == nil { | ||||
|   | ||||
							
								
								
									
										28
									
								
								vendor/github.com/urfave/cli/v2/appveyor.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								vendor/github.com/urfave/cli/v2/appveyor.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,28 +0,0 @@ | ||||
| version: "{build}" | ||||
|  | ||||
| os: Windows Server 2016 | ||||
|  | ||||
| image: Visual Studio 2017 | ||||
|  | ||||
| clone_folder: c:\gopath\src\github.com\urfave\cli | ||||
|  | ||||
| cache: | ||||
|   - node_modules | ||||
|  | ||||
| environment: | ||||
|   GOPATH: C:\gopath | ||||
|   GOVERSION: 1.11.x | ||||
|   GO111MODULE: on | ||||
|   GOPROXY: https://proxy.golang.org | ||||
|  | ||||
| install: | ||||
|   - set PATH=%GOPATH%\bin;C:\go\bin;%PATH% | ||||
|   - go version | ||||
|   - go env | ||||
|   - go get github.com/urfave/gfmrun/cmd/gfmrun | ||||
|   - go mod tidy | ||||
|  | ||||
| build_script: | ||||
|   - go run build.go vet | ||||
|   - go run build.go test | ||||
|   - go run build.go gfmrun docs/v1/manual.md | ||||
							
								
								
									
										6
									
								
								vendor/github.com/urfave/cli/v2/command.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/github.com/urfave/cli/v2/command.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -41,8 +41,11 @@ type Command struct { | ||||
| 	Flags []Flag | ||||
| 	// Treat all flags as normal arguments if true | ||||
| 	SkipFlagParsing bool | ||||
| 	// Boolean to hide built-in help command | ||||
| 	// Boolean to hide built-in help command and help flag | ||||
| 	HideHelp bool | ||||
| 	// Boolean to hide built-in help command but keep help flag | ||||
| 	// Ignored if HideHelp is true. | ||||
| 	HideHelpCommand bool | ||||
| 	// Boolean to hide this command from help or completion | ||||
| 	Hidden bool | ||||
| 	// Boolean to enable short-option handling so user can combine several | ||||
| @@ -236,6 +239,7 @@ func (c *Command) startApp(ctx *Context) error { | ||||
| 	app.Commands = c.Subcommands | ||||
| 	app.Flags = c.Flags | ||||
| 	app.HideHelp = c.HideHelp | ||||
| 	app.HideHelpCommand = c.HideHelpCommand | ||||
|  | ||||
| 	app.Version = ctx.App.Version | ||||
| 	app.HideVersion = ctx.App.HideVersion | ||||
|   | ||||
							
								
								
									
										1
									
								
								vendor/github.com/urfave/cli/v2/context.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/urfave/cli/v2/context.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -17,7 +17,6 @@ type Context struct { | ||||
| 	App           *App | ||||
| 	Command       *Command | ||||
| 	shellComplete bool | ||||
| 	setFlags      map[string]bool | ||||
| 	flagSet       *flag.FlagSet | ||||
| 	parentContext *Context | ||||
| } | ||||
|   | ||||
							
								
								
									
										42
									
								
								vendor/github.com/urfave/cli/v2/flag.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										42
									
								
								vendor/github.com/urfave/cli/v2/flag.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -36,7 +36,7 @@ var VersionFlag Flag = &BoolFlag{ | ||||
|  | ||||
| // HelpFlag prints the help for all commands and subcommands. | ||||
| // Set to nil to disable the flag.  The subcommand | ||||
| // will still be added unless HideHelp is set to true. | ||||
| // will still be added unless HideHelp or HideHelpCommand is set to true. | ||||
| var HelpFlag Flag = &BoolFlag{ | ||||
| 	Name:    "help", | ||||
| 	Aliases: []string{"h"}, | ||||
| @@ -203,12 +203,9 @@ func withEnvHint(envVars []string, str string) string { | ||||
| 	return str + envText | ||||
| } | ||||
|  | ||||
| func flagNames(f Flag) []string { | ||||
| func flagNames(name string, aliases []string) []string { | ||||
| 	var ret []string | ||||
|  | ||||
| 	name := flagStringField(f, "Name") | ||||
| 	aliases := flagStringSliceField(f, "Aliases") | ||||
|  | ||||
| 	for _, part := range append([]string{name}, aliases...) { | ||||
| 		// v1 -> v2 migration warning zone: | ||||
| 		// Strip off anything after the first found comma or space, which | ||||
| @@ -231,17 +228,6 @@ func flagStringSliceField(f Flag, name string) []string { | ||||
| 	return []string{} | ||||
| } | ||||
|  | ||||
| func flagStringField(f Flag, name string) string { | ||||
| 	fv := flagValue(f) | ||||
| 	field := fv.FieldByName(name) | ||||
|  | ||||
| 	if field.IsValid() { | ||||
| 		return field.String() | ||||
| 	} | ||||
|  | ||||
| 	return "" | ||||
| } | ||||
|  | ||||
| func withFileHint(filePath, str string) string { | ||||
| 	fileText := "" | ||||
| 	if filePath != "" { | ||||
| @@ -258,22 +244,26 @@ func flagValue(f Flag) reflect.Value { | ||||
| 	return fv | ||||
| } | ||||
|  | ||||
| func formatDefault(format string) string { | ||||
| 	return " (default: " + format + ")" | ||||
| } | ||||
|  | ||||
| func stringifyFlag(f Flag) string { | ||||
| 	fv := flagValue(f) | ||||
|  | ||||
| 	switch f.(type) { | ||||
| 	switch f := f.(type) { | ||||
| 	case *IntSliceFlag: | ||||
| 		return withEnvHint(flagStringSliceField(f, "EnvVars"), | ||||
| 			stringifyIntSliceFlag(f.(*IntSliceFlag))) | ||||
| 			stringifyIntSliceFlag(f)) | ||||
| 	case *Int64SliceFlag: | ||||
| 		return withEnvHint(flagStringSliceField(f, "EnvVars"), | ||||
| 			stringifyInt64SliceFlag(f.(*Int64SliceFlag))) | ||||
| 			stringifyInt64SliceFlag(f)) | ||||
| 	case *Float64SliceFlag: | ||||
| 		return withEnvHint(flagStringSliceField(f, "EnvVars"), | ||||
| 			stringifyFloat64SliceFlag(f.(*Float64SliceFlag))) | ||||
| 			stringifyFloat64SliceFlag(f)) | ||||
| 	case *StringSliceFlag: | ||||
| 		return withEnvHint(flagStringSliceField(f, "EnvVars"), | ||||
| 			stringifyStringSliceFlag(f.(*StringSliceFlag))) | ||||
| 			stringifyStringSliceFlag(f)) | ||||
| 	} | ||||
|  | ||||
| 	placeholder, usage := unquoteUsage(fv.FieldByName("Usage").String()) | ||||
| @@ -283,20 +273,20 @@ func stringifyFlag(f Flag) string { | ||||
| 	val := fv.FieldByName("Value") | ||||
| 	if val.IsValid() { | ||||
| 		needsPlaceholder = val.Kind() != reflect.Bool | ||||
| 		defaultValueString = fmt.Sprintf(" (default: %v)", val.Interface()) | ||||
| 		defaultValueString = fmt.Sprintf(formatDefault("%v"), val.Interface()) | ||||
|  | ||||
| 		if val.Kind() == reflect.String && val.String() != "" { | ||||
| 			defaultValueString = fmt.Sprintf(" (default: %q)", val.String()) | ||||
| 			defaultValueString = fmt.Sprintf(formatDefault("%q"), val.String()) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	helpText := fv.FieldByName("DefaultText") | ||||
| 	if helpText.IsValid() && helpText.String() != "" { | ||||
| 		needsPlaceholder = val.Kind() != reflect.Bool | ||||
| 		defaultValueString = fmt.Sprintf(" (default: %s)", helpText.String()) | ||||
| 		defaultValueString = fmt.Sprintf(formatDefault("%s"), helpText.String()) | ||||
| 	} | ||||
|  | ||||
| 	if defaultValueString == " (default: )" { | ||||
| 	if defaultValueString == formatDefault("") { | ||||
| 		defaultValueString = "" | ||||
| 	} | ||||
|  | ||||
| @@ -365,7 +355,7 @@ func stringifySliceFlag(usage string, names, defaultVals []string) string { | ||||
|  | ||||
| 	defaultVal := "" | ||||
| 	if len(defaultVals) > 0 { | ||||
| 		defaultVal = fmt.Sprintf(" (default: %s)", strings.Join(defaultVals, ", ")) | ||||
| 		defaultVal = fmt.Sprintf(formatDefault("%s"), strings.Join(defaultVals, ", ")) | ||||
| 	} | ||||
|  | ||||
| 	usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultVal)) | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_bool.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_bool.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -34,7 +34,7 @@ func (f *BoolFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *BoolFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_duration.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_duration.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -34,7 +34,7 @@ func (f *DurationFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *DurationFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_float64.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_float64.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -34,7 +34,7 @@ func (f *Float64Flag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *Float64Flag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										8
									
								
								vendor/github.com/urfave/cli/v2/flag_float64_slice.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/urfave/cli/v2/flag_float64_slice.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -90,7 +90,7 @@ func (f *Float64SliceFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *Float64SliceFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
| @@ -155,11 +155,9 @@ func (c *Context) Float64Slice(name string) []float64 { | ||||
| func lookupFloat64Slice(name string, set *flag.FlagSet) []float64 { | ||||
| 	f := set.Lookup(name) | ||||
| 	if f != nil { | ||||
| 		parsed, err := (f.Value.(*Float64Slice)).Value(), error(nil) | ||||
| 		if err != nil { | ||||
| 			return nil | ||||
| 		if slice, ok := f.Value.(*Float64Slice); ok { | ||||
| 			return slice.Value() | ||||
| 		} | ||||
| 		return parsed | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_generic.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_generic.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -39,7 +39,7 @@ func (f *GenericFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *GenericFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_int.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_int.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -34,7 +34,7 @@ func (f *IntFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *IntFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_int64.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_int64.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -34,7 +34,7 @@ func (f *Int64Flag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *Int64Flag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										8
									
								
								vendor/github.com/urfave/cli/v2/flag_int64_slice.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/urfave/cli/v2/flag_int64_slice.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -91,7 +91,7 @@ func (f *Int64SliceFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *Int64SliceFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
| @@ -151,11 +151,9 @@ func (c *Context) Int64Slice(name string) []int64 { | ||||
| func lookupInt64Slice(name string, set *flag.FlagSet) []int64 { | ||||
| 	f := set.Lookup(name) | ||||
| 	if f != nil { | ||||
| 		parsed, err := (f.Value.(*Int64Slice)).Value(), error(nil) | ||||
| 		if err != nil { | ||||
| 			return nil | ||||
| 		if slice, ok := f.Value.(*Int64Slice); ok { | ||||
| 			return slice.Value() | ||||
| 		} | ||||
| 		return parsed | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|   | ||||
							
								
								
									
										8
									
								
								vendor/github.com/urfave/cli/v2/flag_int_slice.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/urfave/cli/v2/flag_int_slice.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -102,7 +102,7 @@ func (f *IntSliceFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *IntSliceFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
| @@ -165,11 +165,9 @@ func (c *Context) IntSlice(name string) []int { | ||||
| func lookupIntSlice(name string, set *flag.FlagSet) []int { | ||||
| 	f := set.Lookup(name) | ||||
| 	if f != nil { | ||||
| 		parsed, err := (f.Value.(*IntSlice)).Value(), error(nil) | ||||
| 		if err != nil { | ||||
| 			return nil | ||||
| 		if slice, ok := f.Value.(*IntSlice); ok { | ||||
| 			return slice.Value() | ||||
| 		} | ||||
| 		return parsed | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_path.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_path.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -30,7 +30,7 @@ func (f *PathFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *PathFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_string.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_string.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -31,7 +31,7 @@ func (f *StringFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *StringFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										24
									
								
								vendor/github.com/urfave/cli/v2/flag_string_slice.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/github.com/urfave/cli/v2/flag_string_slice.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -71,6 +71,7 @@ type StringSliceFlag struct { | ||||
| 	Value       *StringSlice | ||||
| 	DefaultText string | ||||
| 	HasBeenSet  bool | ||||
| 	Destination *StringSlice | ||||
| } | ||||
|  | ||||
| // IsSet returns whether or not the flag has been set through env or file | ||||
| @@ -86,7 +87,7 @@ func (f *StringSliceFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *StringSliceFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
| @@ -117,13 +118,20 @@ func (f *StringSliceFlag) GetValue() string { | ||||
| func (f *StringSliceFlag) Apply(set *flag.FlagSet) error { | ||||
| 	if val, ok := flagFromEnvOrFile(f.EnvVars, f.FilePath); ok { | ||||
| 		f.Value = &StringSlice{} | ||||
| 		destination := f.Value | ||||
| 		if f.Destination != nil { | ||||
| 			destination = f.Destination | ||||
| 		} | ||||
|  | ||||
| 		for _, s := range strings.Split(val, ",") { | ||||
| 			if err := f.Value.Set(strings.TrimSpace(s)); err != nil { | ||||
| 			if err := destination.Set(strings.TrimSpace(s)); err != nil { | ||||
| 				return fmt.Errorf("could not parse %q as string value for flag %s: %s", val, f.Name, err) | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		// Set this to false so that we reset the slice if we then set values from | ||||
| 		// flags that have already been set by the environment. | ||||
| 		destination.hasBeenSet = false | ||||
| 		f.HasBeenSet = true | ||||
| 	} | ||||
|  | ||||
| @@ -131,6 +139,12 @@ func (f *StringSliceFlag) Apply(set *flag.FlagSet) error { | ||||
| 		if f.Value == nil { | ||||
| 			f.Value = &StringSlice{} | ||||
| 		} | ||||
|  | ||||
| 		if f.Destination != nil { | ||||
| 			set.Var(f.Destination, name, f.Usage) | ||||
| 			continue | ||||
| 		} | ||||
|  | ||||
| 		set.Var(f.Value, name, f.Usage) | ||||
| 	} | ||||
|  | ||||
| @@ -149,11 +163,9 @@ func (c *Context) StringSlice(name string) []string { | ||||
| func lookupStringSlice(name string, set *flag.FlagSet) []string { | ||||
| 	f := set.Lookup(name) | ||||
| 	if f != nil { | ||||
| 		parsed, err := (f.Value.(*StringSlice)).Value(), error(nil) | ||||
| 		if err != nil { | ||||
| 			return nil | ||||
| 		if slice, ok := f.Value.(*StringSlice); ok { | ||||
| 			return slice.Value() | ||||
| 		} | ||||
| 		return parsed | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_timestamp.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_timestamp.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -86,7 +86,7 @@ func (f *TimestampFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *TimestampFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_uint.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_uint.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -34,7 +34,7 @@ func (f *UintFlag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *UintFlag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_uint64.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/urfave/cli/v2/flag_uint64.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -34,7 +34,7 @@ func (f *Uint64Flag) String() string { | ||||
|  | ||||
| // Names returns the names of the flag | ||||
| func (f *Uint64Flag) Names() []string { | ||||
| 	return flagNames(f) | ||||
| 	return flagNames(f.Name, f.Aliases) | ||||
| } | ||||
|  | ||||
| // IsRequired returns whether or not the flag is required | ||||
|   | ||||
							
								
								
									
										11
									
								
								vendor/github.com/urfave/cli/v2/template.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								vendor/github.com/urfave/cli/v2/template.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -56,10 +56,13 @@ OPTIONS: | ||||
| // cli.go uses text/template to render templates. You can | ||||
| // render custom help text by setting this variable. | ||||
| var SubcommandHelpTemplate = `NAME: | ||||
|    {{.HelpName}} - {{if .Description}}{{.Description}}{{else}}{{.Usage}}{{end}} | ||||
|    {{.HelpName}} - {{.Usage}} | ||||
|  | ||||
| USAGE: | ||||
|    {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}} | ||||
|    {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Description}} | ||||
|  | ||||
| DESCRIPTION: | ||||
|    {{.Description}}{{end}} | ||||
|  | ||||
| COMMANDS:{{range .VisibleCategories}}{{if .Name}} | ||||
|    {{.Name}}:{{range .VisibleCommands}} | ||||
| @@ -71,9 +74,7 @@ OPTIONS: | ||||
|    {{end}}{{end}} | ||||
| ` | ||||
|  | ||||
| var MarkdownDocTemplate = `% {{ .App.Name }}(8){{ if .App.Description }} {{ .App.Description }}{{ end }} | ||||
| {{ range $a := .App.Authors }} | ||||
| % {{ $a }}{{ end }} | ||||
| var MarkdownDocTemplate = `% {{ .App.Name }} 8 | ||||
|  | ||||
| # NAME | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 6543
					6543