From eec039c09a79f2e333dcdcbae4dbb3d88a9c303d Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Fri, 27 Aug 2021 08:19:29 -0700 Subject: [PATCH] Add character limit cli --- amanuensis/cli/lexicon.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/amanuensis/cli/lexicon.py b/amanuensis/cli/lexicon.py index 0c0e3c1..c3ea481 100644 --- a/amanuensis/cli/lexicon.py +++ b/amanuensis/cli/lexicon.py @@ -49,6 +49,7 @@ def command_create(args): @add_argument("--no-public", dest="public", action="store_const", const=False) @add_argument("--join", dest="join", action="store_const", const=True) @add_argument("--no-join", dest="join", action="store_const", const=False) +@add_argument("--char-limit", type=int, default=None) def command_edit(args): """ Update a lexicon's configuration. @@ -66,6 +67,9 @@ def command_edit(args): elif args.join == False: values["joinable"] = False + if args.char_limit: + values["character_limit"] = args.char_limit + result = db(update(Lexicon).where(Lexicon.name == args.name).values(**values)) LOG.info(f"Updated {result.rowcount} lexicons") db.session.commit()