fixed readme formatting and added two excepts for the mode modifier

This commit is contained in:
deadvey
2026-03-29 20:15:20 +01:00
parent 0b0baf21b2
commit 7f49d241d8
2 changed files with 16 additions and 14 deletions

View File

@@ -1,13 +1,13 @@
All these options overide configuration in config.json All these options overide configuration in config.json<br/>
**--wpm, -w <int>** **--wpm, -w <int>**<br/>
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. 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.<br/>
**--mode, -m <mode> <mod>** **--mode, -m <mode> <mod>**<br/>
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. 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.<br/>
**--language, -l <language>** **--language, -l <language>**<br/>
Selects a language, defaults to english, must be a listed language in -i Selects a language, defaults to english, must be a listed language in -i<br/>
**--list-quotes, -q** **--list-quotes, -q**<br/>
Lists the available quotes and exits Lists the available quotes and exits<br/>
**--list-languages, -i** **--list-languages, -i**<br/>
Lists the installed languages and exits Lists the installed languages and exits<br/>
**--help, -h** **--help, -h**<br/>
Output's this help text and exits Output's this help text and exits<br/>

View File

@@ -11,8 +11,10 @@ def handle_arguments(arguments, config):
config['mode'] = arguments[index+2] config['mode'] = arguments[index+2]
try: try:
config['mode_modifier'] = int(arguments[index+3]) config['mode_modifier'] = int(arguments[index+3])
except: except ValueError:
config['mode_modifier'] = arguments[index+3] config['mode_modifier'] = arguments[index+3]
except IndexError:
config.pop('mode_modifier',None)
case '--list-languages'|'-i': case '--list-languages'|'-i':
languages = os.listdir('languages') languages = os.listdir('languages')
for lang in languages: for lang in languages: