diff --git a/pkg/cli/cmds/root.go b/pkg/cli/cmds/root.go index 8233fcb90e..423b8dce65 100644 --- a/pkg/cli/cmds/root.go +++ b/pkg/cli/cmds/root.go @@ -13,7 +13,7 @@ var ( Debug bool DebugFlag = cli.BoolFlag{ Name: "debug", - Usage: "Turn on debug logs", + Usage: "(logging) Turn on debug logs", Destination: &Debug, EnvVar: version.ProgramUpper + "_DEBUG", } diff --git a/pkg/cli/cmds/server.go b/pkg/cli/cmds/server.go index 5b4e61ae76..367b8e3d60 100644 --- a/pkg/cli/cmds/server.go +++ b/pkg/cli/cmds/server.go @@ -77,6 +77,8 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command { Before: SetupDebug(CheckSELinuxFlags), Action: action, Flags: []cli.Flag{ + ConfigFlag, + DebugFlag, VLevel, VModule, LogFile, diff --git a/pkg/configfilearg/parser.go b/pkg/configfilearg/parser.go index 600e56f413..4533fcac8a 100644 --- a/pkg/configfilearg/parser.go +++ b/pkg/configfilearg/parser.go @@ -104,15 +104,11 @@ func readConfigFile(file string) (result []string, _ error) { if slice, ok := v.([]interface{}); ok { for _, v := range slice { - result = append(result, prefix+k, convert.ToString(v)) - result = append(result) + result = append(result, prefix+k+"="+convert.ToString(v)) } } else { str := convert.ToString(v) - result = append(result, prefix+k) - if str != "" { - result = append(result, str) - } + result = append(result, prefix+k+"="+str) } } diff --git a/pkg/configfilearg/parser_test.go b/pkg/configfilearg/parser_test.go index 47145e1daa..675a53f68a 100644 --- a/pkg/configfilearg/parser_test.go +++ b/pkg/configfilearg/parser_test.go @@ -150,14 +150,15 @@ func TestConfigFile(t *testing.T) { func TestParse(t *testing.T) { testDataOutput := []string{ - "--foo-bar", "baz", - "--a-slice", "1", - "--a-slice", "2", - "--a-slice", "", - "--a-slice", "three", - "--isempty", - "-c", "b", - "--islast", "true", + "--foo-bar=baz", + "--a-slice=1", + "--a-slice=2", + "--a-slice=", + "--a-slice=three", + "--isempty=", + "-c=b", + "--isfalse=false", + "--islast=true", } defParser := Parser{ diff --git a/pkg/configfilearg/testdata/data.yaml b/pkg/configfilearg/testdata/data.yaml index 61910e4d1a..35105341ad 100644 --- a/pkg/configfilearg/testdata/data.yaml +++ b/pkg/configfilearg/testdata/data.yaml @@ -6,4 +6,5 @@ a-slice: - three isempty: c: b +isfalse: false islast: true \ No newline at end of file