From 63f27f918c8e0e6a0ae24e0b9315c2f2f7b49b6f Mon Sep 17 00:00:00 2001 From: Aineopintojen-harjoitustyo-Algoritmit-j Date: Sat, 3 Feb 2024 11:08:27 +0200 Subject: Implementing file reader. --- cmdline.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cmdline.py') 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() -- cgit v1.2.3