From a73f7b6cdce9de791b531ad340b22f129bf40a41 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Fri, 24 Jan 2020 10:18:05 -0800 Subject: [PATCH] Allow setting password via CLI for scripting --- amanuensis/cli/user.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/amanuensis/cli/user.py b/amanuensis/cli/user.py index 8819876..215b74d 100644 --- a/amanuensis/cli/user.py +++ b/amanuensis/cli/user.py @@ -107,6 +107,7 @@ def command_config(args): config_set(u.id, cfg, args.set) @add_argument("--username", help="The user to change password for") +@add_argument("--password", help="The password to set. Not recommended") def command_passwd(args): """ Set a user's password @@ -123,5 +124,5 @@ def command_passwd(args): if u is None: logger.error("No user with username '{}'".format(args.username)) return -1 - pw = getpass.getpass("Password: ") + pw = args.password or getpass.getpass("Password: ") u.set_password(pw)