Commit 898cbeb9 authored by Brian Downs's avatar Brian Downs

Merge remote-tracking branch 'upstream/master' into issue-112

parents 00831f9b 289ba8df
...@@ -13,7 +13,7 @@ var ( ...@@ -13,7 +13,7 @@ var (
Debug bool Debug bool
DebugFlag = cli.BoolFlag{ DebugFlag = cli.BoolFlag{
Name: "debug", Name: "debug",
Usage: "Turn on debug logs", Usage: "(logging) Turn on debug logs",
Destination: &Debug, Destination: &Debug,
EnvVar: version.ProgramUpper + "_DEBUG", EnvVar: version.ProgramUpper + "_DEBUG",
} }
......
...@@ -77,6 +77,8 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command { ...@@ -77,6 +77,8 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
Before: SetupDebug(CheckSELinuxFlags), Before: SetupDebug(CheckSELinuxFlags),
Action: action, Action: action,
Flags: []cli.Flag{ Flags: []cli.Flag{
ConfigFlag,
DebugFlag,
VLevel, VLevel,
VModule, VModule,
LogFile, LogFile,
......
...@@ -104,15 +104,11 @@ func readConfigFile(file string) (result []string, _ error) { ...@@ -104,15 +104,11 @@ func readConfigFile(file string) (result []string, _ error) {
if slice, ok := v.([]interface{}); ok { if slice, ok := v.([]interface{}); ok {
for _, v := range slice { for _, v := range slice {
result = append(result, prefix+k, convert.ToString(v)) result = append(result, prefix+k+"="+convert.ToString(v))
result = append(result)
} }
} else { } else {
str := convert.ToString(v) str := convert.ToString(v)
result = append(result, prefix+k) result = append(result, prefix+k+"="+str)
if str != "" {
result = append(result, str)
}
} }
} }
......
...@@ -150,14 +150,15 @@ func TestConfigFile(t *testing.T) { ...@@ -150,14 +150,15 @@ func TestConfigFile(t *testing.T) {
func TestParse(t *testing.T) { func TestParse(t *testing.T) {
testDataOutput := []string{ testDataOutput := []string{
"--foo-bar", "baz", "--foo-bar=baz",
"--a-slice", "1", "--a-slice=1",
"--a-slice", "2", "--a-slice=2",
"--a-slice", "", "--a-slice=",
"--a-slice", "three", "--a-slice=three",
"--isempty", "--isempty=",
"-c", "b", "-c=b",
"--islast", "true", "--isfalse=false",
"--islast=true",
} }
defParser := Parser{ defParser := Parser{
......
...@@ -6,4 +6,5 @@ a-slice: ...@@ -6,4 +6,5 @@ a-slice:
- three - three
isempty: isempty:
c: b c: b
isfalse: false
islast: true islast: true
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment