Implement char-list as config-get for now

This commit is contained in:
Tim Van Baak 2020-01-20 19:59:41 -08:00
parent ccc027d5ef
commit 5e25c433ee

View File

@ -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