Refactor arguments parsing

And change some defaults
master
Lertsenem 2020-07-21 00:35:56 +02:00
parent 8b61e6b8a6
commit 2ea7b3afc4
1 changed files with 14 additions and 11 deletions

View File

@ -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",
parser.add_argument(
"--proxy", "-p",
default = None,
help = "the proxy to use" )
help = "the proxy to use",
)
parser.add_argument( "--token", "-t",
parser.add_argument(
"--token", "-t",
default = None,
help = "the authentication token to use" )
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,