From 7f49d241d85c3a770f18a370fe0c8931b56ddc7f Mon Sep 17 00:00:00 2001 From: deadvey Date: Sun, 29 Mar 2026 20:15:20 +0100 Subject: [PATCH] fixed readme formatting and added two excepts for the mode modifier --- README.md | 26 +++++++++++++------------- args.py | 4 +++- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 945a278..806650a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -All these options overide configuration in config.json -**--wpm, -w ** - set the rate of dictation, defaults to 50, note: this is not exact as it measures the time between words in order to avoid a very short gap after a long word. -**--mode, -m ** - Sets a mode, one of 'timed', 'words','quote' or 'file' followed by an optional modifier representing either the time (in seconds) or the number of words, or the quote ID, or the file name. -**--language, -l ** - Selects a language, defaults to english, must be a listed language in -i -**--list-quotes, -q** - Lists the available quotes and exits -**--list-languages, -i** - Lists the installed languages and exits -**--help, -h** - Output's this help text and exits +All these options overide configuration in config.json
+**--wpm, -w **
+ set the rate of dictation, defaults to 50, note: this is not exact as it measures the time between words in order to avoid a very short gap after a long word.
+**--mode, -m **
+ Sets a mode, one of 'timed', 'words','quote' or 'file' followed by an optional modifier representing either the time (in seconds) or the number of words, or the quote ID, or the file name.
+**--language, -l **
+ Selects a language, defaults to english, must be a listed language in -i
+**--list-quotes, -q**
+ Lists the available quotes and exits
+**--list-languages, -i**
+ Lists the installed languages and exits
+**--help, -h**
+ Output's this help text and exits
diff --git a/args.py b/args.py index 8791538..e85ddfb 100644 --- a/args.py +++ b/args.py @@ -11,8 +11,10 @@ def handle_arguments(arguments, config): config['mode'] = arguments[index+2] try: config['mode_modifier'] = int(arguments[index+3]) - except: + except ValueError: config['mode_modifier'] = arguments[index+3] + except IndexError: + config.pop('mode_modifier',None) case '--list-languages'|'-i': languages = os.listdir('languages') for lang in languages: