From 5ed084147d42beae0cf4ac21f7b8d608e666ea51 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Fri, 3 Jan 2020 17:06:45 -0800 Subject: [PATCH] Make command names easier to type --- amanuensis/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amanuensis/__main__.py b/amanuensis/__main__.py index 5681c01..71db5a2 100644 --- a/amanuensis/__main__.py +++ b/amanuensis/__main__.py @@ -12,7 +12,7 @@ def repl(args): """Runs a REPL with the given lexicon""" # Get all the cli commands' descriptions and add help and exit. commands = { - name[8:]: func.__doc__ for name, func in vars(cli).items() + name[8:].replace("_", "-"): func.__doc__ for name, func in vars(cli).items() if name.startswith("command_")} commands['help'] = "Print this message" commands['exit'] = "Exit" @@ -106,7 +106,7 @@ def get_parser(valid_commands): def main(argv): # Enumerate valid commands from the CLI module. commands = { - name[8:] : func + name[8:].replace("_", "-") : func for name, func in vars(cli).items() if name.startswith("command_")}