Added epilog field

This commit is contained in:
mpeterv
2014-02-23 16:44:13 +04:00
parent 7994dded7e
commit 5c82cb4c2e
2 changed files with 25 additions and 4 deletions

View File

@@ -32,6 +32,23 @@ describe("tests related to help message generation", function()
}, "\r\n"), parser:prepare():get_help())
end)
it("uses description and epilog", function()
local parser = Parser "foo"
:description "A description. "
:epilog "An epilog. "
assert.equal(table.concat({
"Usage: foo [-h]",
"",
"A description. ",
"",
"Options: ",
" -h, --help Show this help message and exit. ",
"",
"An epilog. "
}, "\r\n"), parser:prepare():get_help())
end)
it("creates correct help message for arguments", function()
local parser = Parser "foo"
parser:argument "first"