Skip to content

Commit

Permalink
Merge branch 'peterlits'
Browse files Browse the repository at this point in the history
let it works in test
  • Loading branch information
PeterlitsZo committed May 16, 2020
2 parents 89a0f45 + 3a5de4f commit e62f62f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion argparse.go
Expand Up @@ -629,7 +629,9 @@ func (o *Command) Usage(msg interface{}) string {
return result
}
// add one more empty line to split error msg and usage message.
result += "\n"
if result != "" {
result += "\n"
}

//collect info about Preceding Commands into chain and arguments
o.getPrecedingCommands(&chain, &arguments)
Expand Down
2 changes: 2 additions & 0 deletions argparse_test.go
Expand Up @@ -2243,6 +2243,7 @@ func TestFloatFail1(t *testing.T) {
}

var pUsageString = `test string
usage: prog [-h|--help]
description:
program description
Expand All @@ -2269,6 +2270,7 @@ func (s s) String() string {
}

var pUsageStringer = `stringer message
usage: prog [-h|--help]
description:
program description
Expand Down

0 comments on commit e62f62f

Please sign in to comment.