Merge branch 'master' into patch-1
This commit is contained in:
commit
3f80cc798f
6
.github/ISSUE_TEMPLATE/v1-bug-report.md
vendored
6
.github/ISSUE_TEMPLATE/v1-bug-report.md
vendored
@ -32,9 +32,13 @@ A clear and concise description of what the bug is.
|
||||
|
||||
Describe the steps or code required to reproduce the behavior
|
||||
|
||||
## Observed behavior
|
||||
|
||||
What did you see happen immediately after the reproduction steps above?
|
||||
|
||||
## Expected behavior
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
What would you have expected to happen immediately after the reproduction steps above?
|
||||
|
||||
## Additional context
|
||||
|
||||
|
6
.github/ISSUE_TEMPLATE/v2-bug-report.md
vendored
6
.github/ISSUE_TEMPLATE/v2-bug-report.md
vendored
@ -32,9 +32,13 @@ A clear and concise description of what the bug is.
|
||||
|
||||
Describe the steps or code required to reproduce the behavior
|
||||
|
||||
## Observed behavior
|
||||
|
||||
What did you see happen immediately after the reproduction steps above?
|
||||
|
||||
## Expected behavior
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
What would you have expected to happen immediately after the reproduction steps above?
|
||||
|
||||
## Additional context
|
||||
|
||||
|
@ -1505,15 +1505,13 @@ func main() {
|
||||
cli.ShowVersion(c)
|
||||
|
||||
fmt.Printf("%#v\n", c.App.Command("doo"))
|
||||
// // uncomment when https://github.com/urfave/cli/pull/1014 is released
|
||||
// if c.Bool("infinite") {
|
||||
// c.App.Run([]string{"app", "doo", "wop"})
|
||||
// }
|
||||
if c.Bool("infinite") {
|
||||
c.App.Run([]string{"app", "doo", "wop"})
|
||||
}
|
||||
|
||||
// // uncomment when https://github.com/urfave/cli/pull/1014 is released
|
||||
// if c.Bool("forevar") {
|
||||
// c.App.RunAsSubcommand(c)
|
||||
// }
|
||||
if c.Bool("forevar") {
|
||||
c.App.RunAsSubcommand(c)
|
||||
}
|
||||
c.App.Setup()
|
||||
fmt.Printf("%#v\n", c.App.VisibleCategories())
|
||||
fmt.Printf("%#v\n", c.App.VisibleCommands())
|
||||
@ -1529,29 +1527,27 @@ func main() {
|
||||
set := flag.NewFlagSet("contrive", 0)
|
||||
nc := cli.NewContext(c.App, set, c)
|
||||
|
||||
// // uncomment when https://github.com/urfave/cli/pull/1014 is released
|
||||
// fmt.Printf("%#v\n", nc.Args())
|
||||
// fmt.Printf("%#v\n", nc.Bool("nope"))
|
||||
// fmt.Printf("%#v\n", !nc.Bool("nerp"))
|
||||
// fmt.Printf("%#v\n", nc.Duration("howlong"))
|
||||
// fmt.Printf("%#v\n", nc.Float64("hay"))
|
||||
// fmt.Printf("%#v\n", nc.Generic("bloop"))
|
||||
// fmt.Printf("%#v\n", nc.Int64("bonk"))
|
||||
// fmt.Printf("%#v\n", nc.Int64Slice("burnks"))
|
||||
// fmt.Printf("%#v\n", nc.Int("bips"))
|
||||
// fmt.Printf("%#v\n", nc.IntSlice("blups"))
|
||||
// fmt.Printf("%#v\n", nc.String("snurt"))
|
||||
// fmt.Printf("%#v\n", nc.StringSlice("snurkles"))
|
||||
// fmt.Printf("%#v\n", nc.Uint("flub"))
|
||||
// fmt.Printf("%#v\n", nc.Uint64("florb"))
|
||||
fmt.Printf("%#v\n", nc.Args())
|
||||
fmt.Printf("%#v\n", nc.Bool("nope"))
|
||||
fmt.Printf("%#v\n", !nc.Bool("nerp"))
|
||||
fmt.Printf("%#v\n", nc.Duration("howlong"))
|
||||
fmt.Printf("%#v\n", nc.Float64("hay"))
|
||||
fmt.Printf("%#v\n", nc.Generic("bloop"))
|
||||
fmt.Printf("%#v\n", nc.Int64("bonk"))
|
||||
fmt.Printf("%#v\n", nc.Int64Slice("burnks"))
|
||||
fmt.Printf("%#v\n", nc.Int("bips"))
|
||||
fmt.Printf("%#v\n", nc.IntSlice("blups"))
|
||||
fmt.Printf("%#v\n", nc.String("snurt"))
|
||||
fmt.Printf("%#v\n", nc.StringSlice("snurkles"))
|
||||
fmt.Printf("%#v\n", nc.Uint("flub"))
|
||||
fmt.Printf("%#v\n", nc.Uint64("florb"))
|
||||
|
||||
// // uncomment when https://github.com/urfave/cli/pull/1014 is released
|
||||
// fmt.Printf("%#v\n", nc.FlagNames())
|
||||
// fmt.Printf("%#v\n", nc.IsSet("wat"))
|
||||
// fmt.Printf("%#v\n", nc.Set("wat", "nope"))
|
||||
// fmt.Printf("%#v\n", nc.NArg())
|
||||
// fmt.Printf("%#v\n", nc.NumFlags())
|
||||
// fmt.Printf("%#v\n", nc.Lineage()[1])
|
||||
fmt.Printf("%#v\n", nc.FlagNames())
|
||||
fmt.Printf("%#v\n", nc.IsSet("wat"))
|
||||
fmt.Printf("%#v\n", nc.Set("wat", "nope"))
|
||||
fmt.Printf("%#v\n", nc.NArg())
|
||||
fmt.Printf("%#v\n", nc.NumFlags())
|
||||
fmt.Printf("%#v\n", nc.Lineage()[1])
|
||||
nc.Set("wat", "also-nope")
|
||||
|
||||
ec := cli.Exit("ohwell", 86)
|
||||
|
10
flag.go
10
flag.go
@ -261,19 +261,19 @@ func flagValue(f Flag) reflect.Value {
|
||||
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())
|
||||
|
Loading…
Reference in New Issue
Block a user