diff options
author | Maximilian Meister <mmeister@suse.de> | 2017-08-11 19:29:05 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-08-11 19:29:05 +0800 |
commit | 2b422b1a47e9b2a0f3d7ecf7063eef2e59cc082e (patch) | |
tree | fe732b8be4c6ec4fb11ed78078b54144fcb4affc /vendor/gopkg.in/urfave/cli.v1/flag.go | |
parent | 73c5aba21fcca1bf1f78e94d88920fde6762be9e (diff) | |
download | go-tangerine-2b422b1a47e9b2a0f3d7ecf7063eef2e59cc082e.tar go-tangerine-2b422b1a47e9b2a0f3d7ecf7063eef2e59cc082e.tar.gz go-tangerine-2b422b1a47e9b2a0f3d7ecf7063eef2e59cc082e.tar.bz2 go-tangerine-2b422b1a47e9b2a0f3d7ecf7063eef2e59cc082e.tar.lz go-tangerine-2b422b1a47e9b2a0f3d7ecf7063eef2e59cc082e.tar.xz go-tangerine-2b422b1a47e9b2a0f3d7ecf7063eef2e59cc082e.tar.zst go-tangerine-2b422b1a47e9b2a0f3d7ecf7063eef2e59cc082e.zip |
cmd/geth, cmd/swarm: sort commands and flags by name (#3462)
Diffstat (limited to 'vendor/gopkg.in/urfave/cli.v1/flag.go')
-rw-r--r-- | vendor/gopkg.in/urfave/cli.v1/flag.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/gopkg.in/urfave/cli.v1/flag.go b/vendor/gopkg.in/urfave/cli.v1/flag.go index 7dd8a2c4a..877ff3523 100644 --- a/vendor/gopkg.in/urfave/cli.v1/flag.go +++ b/vendor/gopkg.in/urfave/cli.v1/flag.go @@ -14,13 +14,13 @@ import ( const defaultPlaceholder = "value" // BashCompletionFlag enables bash-completion for all commands and subcommands -var BashCompletionFlag = BoolFlag{ +var BashCompletionFlag Flag = BoolFlag{ Name: "generate-bash-completion", Hidden: true, } // VersionFlag prints the version for the application -var VersionFlag = BoolFlag{ +var VersionFlag Flag = BoolFlag{ Name: "version, v", Usage: "print the version", } @@ -28,7 +28,7 @@ var VersionFlag = BoolFlag{ // HelpFlag prints the help for all commands and subcommands // Set to the zero value (BoolFlag{}) to disable flag -- keeps subcommand // unless HideHelp is set to true) -var HelpFlag = BoolFlag{ +var HelpFlag Flag = BoolFlag{ Name: "help, h", Usage: "show help", } @@ -630,7 +630,8 @@ func (f Float64Flag) ApplyWithError(set *flag.FlagSet) error { func visibleFlags(fl []Flag) []Flag { visible := []Flag{} for _, flag := range fl { - if !flagValue(flag).FieldByName("Hidden").Bool() { + field := flagValue(flag).FieldByName("Hidden") + if !field.IsValid() || !field.Bool() { visible = append(visible, flag) } } @@ -723,9 +724,8 @@ func stringifyFlag(f Flag) string { needsPlaceholder := false defaultValueString := "" - val := fv.FieldByName("Value") - if val.IsValid() { + if val := fv.FieldByName("Value"); val.IsValid() { needsPlaceholder = true defaultValueString = fmt.Sprintf(" (default: %v)", val.Interface()) |