factor out argparse.ArgumentParser to allow for generating completions via shtab

This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-10-16 14:14:40 +02:00
parent b25429a4c1
commit 85cbe1d128
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -3766,7 +3766,7 @@ def gui():
app.mainloop()
def main(argv=sys.argv):
def get_main_parser():
rendered_papersizes = ""
for k, v in sorted(papersizes.items()):
rendered_papersizes += " %-8s %s\n" % (papernames[k], v)
@ -4329,8 +4329,11 @@ and left/right, respectively. It is not possible to specify asymmetric borders.
action="store_true",
help="Instruct the PDF viewer to open the PDF in fullscreen mode",
)
return parser
args = parser.parse_args(argv[1:])
def main(argv=sys.argv):
args = get_main_parser().parse_args(argv[1:])
if args.verbose:
logging.basicConfig(level=logging.DEBUG)