From 2ea7b3afc4f5a9d766c96b90d2ad172ebdea8fd9 Mon Sep 17 00:00:00 2001 From: Lertsenem Date: Tue, 21 Jul 2020 00:35:56 +0200 Subject: [PATCH] Refactor arguments parsing And change some defaults --- lokrez/__init__.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lokrez/__init__.py b/lokrez/__init__.py index 6df7f63..355512f 100644 --- a/lokrez/__init__.py +++ b/lokrez/__init__.py @@ -21,21 +21,26 @@ ROOTDIR = os.path.dirname(os.path.abspath(__file__)) def main(): # ------------------------------------------------------------------------- - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser( + formatter_class = argparse.ArgumentDefaultsHelpFormatter, + ) subparsers = parser.add_subparsers( dest = "command", help = "commands", ) - parser.add_argument( "--proxy", "-p", - default = None, - help = "the proxy to use" ) - - parser.add_argument( "--token", "-t", - default = None, - help = "the authentication token to use" ) + parser.add_argument( + "--proxy", "-p", + default = None, + help = "the proxy to use", + ) + parser.add_argument( + "--token", "-t", + default = None, + help = "the authentication token to use", + ) # ------------------------------------------------------------------------- init_parser = subparsers.add_parser( @@ -83,7 +88,7 @@ def main(): ) top8_parser.add_argument( "--template", "-T", - default = "rebootlyon", + default = "rebootlyon2020", help = "The local result template to use", ) top8_parser.add_argument( @@ -92,14 +97,12 @@ def main(): help = "The lkrz file in which the results are stored ; if it " \ "does not exist, one will be created from the smashgg data", ) - top8_parser.add_argument( "--outfile", "-o", default = None, help = "The SVG local result file to output to ; defaults to " \ "./tournament-slug.svg", ) - top8_parser.add_argument( "--name-seo-delimiter", default = None,