Pad long usage messages

Long usage messages are split into lines. A margin is added so that they line up under "Usage: " part of the message.
This commit is contained in:
mpeterv
2014-02-18 13:28:06 +04:00
parent ccad58ef50
commit 07af666206
3 changed files with 23 additions and 11 deletions

View File

@@ -18,9 +18,10 @@ describe("tests related to usage message generation", function()
parser:argument "others"
:args "*"
assert.equal(
[=[Usage: foo <first> <second-and-third> <second-and-third> [<maybe-fourth>] [<others>] ...]=],
parser:prepare():get_usage()
assert.equal(table.concat({
"Usage: foo <first> <second-and-third> <second-and-third>",
" [<maybe-fourth>] [<others>] ..."
}, "\r\n"), parser:prepare():get_usage()
)
end)