summaryrefslogtreecommitdiff
path: root/cmdline.py
diff options
context:
space:
mode:
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()