From 5e25c433ee84d8ac89354dcaf4b437a092f39e78 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Mon, 20 Jan 2020 19:59:41 -0800 Subject: [PATCH] Implement char-list as config-get for now --- amanuensis/cli/lexicon.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/amanuensis/cli/lexicon.py b/amanuensis/cli/lexicon.py index c04d85f..8122ec8 100644 --- a/amanuensis/cli/lexicon.py +++ b/amanuensis/cli/lexicon.py @@ -257,7 +257,18 @@ def command_char_list(args): """ List all characters in a lexicon """ - raise NotImplementedError() # TODO + import json + # Module imports + from lexicon import LexiconModel + + # Verify arguments + lex = LexiconModel.by(name=args.lexicon) + if lex is None: + logger.error("Could not find lexicon '{}'".format(args.lexicon)) + return -1 + + # Internal call + print(json.dumps(lex.character, indent=2)) # # Procedural commands