summaryrefslogtreecommitdiff
path: root/vendor/github.com/urfave/cli/flag.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/urfave/cli/flag.go')
-rw-r--r--vendor/github.com/urfave/cli/flag.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/github.com/urfave/cli/flag.go b/vendor/github.com/urfave/cli/flag.go
index d4a4d41a2..b0cffc006 100644
--- a/vendor/github.com/urfave/cli/flag.go
+++ b/vendor/github.com/urfave/cli/flag.go
@@ -636,7 +636,7 @@ func withEnvHint(envVar, str string) string {
suffix = "%"
sep = "%, %"
}
- envText = fmt.Sprintf(" [%s%s%s]", prefix, strings.Join(strings.Split(envVar, ","), sep), suffix)
+ envText = " [" + prefix + strings.Join(strings.Split(envVar, ","), sep) + suffix + "]"
}
return str + envText
}
@@ -709,13 +709,13 @@ func stringifyFlag(f Flag) string {
placeholder = defaultPlaceholder
}
- usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultValueString))
+ usageWithDefault := strings.TrimSpace(usage + defaultValueString)
return FlagFileHinter(
fv.FieldByName("FilePath").String(),
FlagEnvHinter(
fv.FieldByName("EnvVar").String(),
- fmt.Sprintf("%s\t%s", FlagNamePrefixer(fv.FieldByName("Name").String(), placeholder), usageWithDefault),
+ FlagNamePrefixer(fv.FieldByName("Name").String(), placeholder)+"\t"+usageWithDefault,
),
)
}
@@ -724,7 +724,7 @@ func stringifyIntSliceFlag(f IntSliceFlag) string {
defaultVals := []string{}
if f.Value != nil && len(f.Value.Value()) > 0 {
for _, i := range f.Value.Value() {
- defaultVals = append(defaultVals, fmt.Sprintf("%d", i))
+ defaultVals = append(defaultVals, strconv.Itoa(i))
}
}
@@ -735,7 +735,7 @@ func stringifyInt64SliceFlag(f Int64SliceFlag) string {
defaultVals := []string{}
if f.Value != nil && len(f.Value.Value()) > 0 {
for _, i := range f.Value.Value() {
- defaultVals = append(defaultVals, fmt.Sprintf("%d", i))
+ defaultVals = append(defaultVals, strconv.FormatInt(i, 10))
}
}
@@ -747,7 +747,7 @@ func stringifyStringSliceFlag(f StringSliceFlag) string {
if f.Value != nil && len(f.Value.Value()) > 0 {
for _, s := range f.Value.Value() {
if len(s) > 0 {
- defaultVals = append(defaultVals, fmt.Sprintf("%q", s))
+ defaultVals = append(defaultVals, strconv.Quote(s))
}
}
}
@@ -766,8 +766,8 @@ func stringifySliceFlag(usage, name string, defaultVals []string) string {
defaultVal = fmt.Sprintf(" (default: %s)", strings.Join(defaultVals, ", "))
}
- usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultVal))
- return fmt.Sprintf("%s\t%s", FlagNamePrefixer(name, placeholder), usageWithDefault)
+ usageWithDefault := strings.TrimSpace(usage + defaultVal)
+ return FlagNamePrefixer(name, placeholder) + "\t" + usageWithDefault
}
func flagFromFileEnv(filePath, envName string) (val string, ok bool) {