From faab574f82993e00e8e1e660de0e150970b654ed Mon Sep 17 00:00:00 2001 From: Christopher Teutsch Date: Sat, 4 May 2019 21:05:47 +0200 Subject: [PATCH] Help in interactive mode --- README.md | 8 ++++---- crawl.py | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 99b57de..7047a56 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,13 @@ Reverse conversion direction (EUR to specified currency, instead of specified cu Calculate interactively on stdin - -##### `q` - Quit. +##### `q`, `exit`, `quit` + Quit the program. ##### `AMOUNT CURRENCY` Convert AMOUNT euros to CURRENCY. ##### `CURRENCY AMOUNT` Convert AMOUNT CURRENCY to euros. - +##### `d`, `date` + Print the date the data is from. diff --git a/crawl.py b/crawl.py index aeb351a..98f1534 100755 --- a/crawl.py +++ b/crawl.py @@ -71,6 +71,13 @@ vals_group.add_argument( def _process_stdin(argv: str, res: utils.CurrencyResult) -> None: argv = argv.split() try: + if argv[0] in ['h', 'man', 'help']: + print("""Usage: +q | exit | quit: Quit the program. +AMOUNT CURRENCY: Convert AMOUNT euros to CURRENCY. +CURRENCY AMOUNT: Convert AMOUNT CURRENCY to euros. +d | date: Print the date which the data is from. + """) if argv[0] in ['q', 'exit', 'quit']: sys.exit() elif argv[0] in ['date', 'd']: