Only add "unless outside selected" if "outside" param is present

Void confusing users if outside param is missing but still be mentioned in
the help text.
This commit is contained in:
Florian Festi 2020-08-02 11:45:54 +02:00
parent b8432e93af
commit 59564a58a7
1 changed files with 12 additions and 3 deletions

View File

@ -376,14 +376,20 @@ class Boxes:
for arg, default in kw.items():
if arg == "x":
if default is None: default = 100.0
help = "inner width in mm"
if "outside" in kw:
help += " (unless outside selected)"
self.argparser.add_argument(
"--x", action="store", type=float, default=default,
help="inner width in mm (unless outside selected)")
help=help)
elif arg == "y":
if default is None: default = 100.0
help = "inner depth in mm"
if "outside" in kw:
help += " (unless outside selected)"
self.argparser.add_argument(
"--y", action="store", type=float, default=default,
help="inner depth in mm (unless outside selected)")
help=help)
elif arg == "sx":
if default is None: default = "50*3"
self.argparser.add_argument(
@ -404,9 +410,12 @@ class Boxes:
help="""sections bottom to top in mm. See --sy for format""")
elif arg == "h":
if default is None: default = 100.0
help = "inner height in mm"
if "outside" in kw:
help += " (unless outside selected)"
self.argparser.add_argument(
"--h", action="store", type=float, default=default,
help="inner height in mm (unless outside selected)")
help=help)
elif arg == "hi":
if default is None: default = 0.0
self.argparser.add_argument(