summaryrefslogtreecommitdiff
path: root/cmdline.py
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-02-03 11:08:27 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-02-03 11:08:27 +0200
commit63f27f918c8e0e6a0ae24e0b9315c2f2f7b49b6f (patch)
tree7ba015dd3310bdf5d79e20867ffeddb48d4198d3 /cmdline.py
parent4253cf1292a40e6c5c7a6a7729c278da4bf69186 (diff)
Implementing file reader.
Diffstat (limited to 'cmdline.py')
-rw-r--r--cmdline.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmdline.py b/cmdline.py
index b75c49c..dd9e3a6 100644
--- a/cmdline.py
+++ b/cmdline.py
@@ -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()