From 7e1ee83a0b59cf6e554e51e00b3ea2bc7706d206 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Sun, 8 Apr 2018 15:14:46 +0300 Subject: [PATCH] Add a test for help generation with long option argument list --- spec/help_spec.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/help_spec.lua b/spec/help_spec.lua index 099bcd2..a93fdc9 100644 --- a/spec/help_spec.lua +++ b/spec/help_spec.lua @@ -155,6 +155,24 @@ Options: -h, --help Show this help message and exit.]], parser:get_help()) end) + it("handles very long argument lists", function() + local parser = Parser "foo" + + parser:option "-t --at-least-three" + :args("3+") + :argname {"", "", ""} + :description "Sometimes argument lists are really long." + + assert.equal([[ +Usage: foo [-h] [-t ...] + +Options: + -t ..., + --at-least-three ... + Sometimes argument lists are really long. + -h, --help Show this help message and exit.]], parser:get_help()) + end) + it("shows default values", function() local parser = Parser "foo" parser:option "-o"