Skip to content

Commit 807a496

Browse files
committed
Revert "test with boolp, does not respect env var priority"
This reverts commit 62b1e1f519b704d14f2d4e4fed555d6da6edd26a.
1 parent 3249d4f commit 807a496

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

cmd/root.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212

1313
type arg struct {
1414
cliShort, cliLong, cfgFileEnvVar, description string
15-
isBool, defaultIfBool bool
1615
}
1716

1817
var (
@@ -158,8 +157,6 @@ var (
158157
}
159158
startCompactArg = arg{
160159
cliLong: "compact-header",
161-
isBool: true,
162-
defaultIfBool: false,
163160
cfgFileEnvVar: "wander_compact_header",
164161
description: `If "true", start with compact header. Default "false"`,
165162
}
@@ -225,11 +222,7 @@ func init() {
225222
startAllTasksView,
226223
compactTablesArg,
227224
} {
228-
if c.isBool {
229-
rootCmd.PersistentFlags().BoolP(c.cliLong, c.cliShort, c.defaultIfBool, c.description)
230-
} else {
231-
rootCmd.PersistentFlags().StringP(c.cliLong, c.cliShort, "", c.description)
232-
}
225+
rootCmd.PersistentFlags().StringP(c.cliLong, c.cliShort, "", c.description)
233226
viper.BindPFlag(c.cliLong, rootCmd.PersistentFlags().Lookup(c.cfgFileEnvVar))
234227
}
235228

0 commit comments

Comments
 (0)