diff options
author | Aineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi> | 2024-02-03 11:08:27 +0200 |
---|---|---|
committer | Aineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi> | 2024-02-03 11:08:27 +0200 |
commit | 63f27f918c8e0e6a0ae24e0b9315c2f2f7b49b6f (patch) | |
tree | 7ba015dd3310bdf5d79e20867ffeddb48d4198d3 /cmdline.py | |
parent | 4253cf1292a40e6c5c7a6a7729c278da4bf69186 (diff) |
Implementing file reader.
Diffstat (limited to 'cmdline.py')
-rw-r--r-- | cmdline.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1,5 +1,9 @@ +""" cmdline.py - komentorivin käsittely argparse moduulilla """ +import sys from argparse import ArgumentParser +from tui import KEY_DESCRIPTIONS + parser = ArgumentParser( prog='miinaharava', description='Klassisen miinaharavapelin terminaali toteutus.', @@ -99,3 +103,10 @@ misc_group.add_argument( args = parser.parse_args() +if args.help: + parser.print_help() + sys.exit() + +if args.keys: + print(end=KEY_DESCRIPTIONS) + sys.exit() |