From d3b199be6dfd6b0083050478c3879363a567eea9 Mon Sep 17 00:00:00 2001 From: Guy Brand Date: Tue, 9 Nov 2021 13:08:09 +0100 Subject: Get password from a file --- calendar-cli.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'calendar-cli.py') diff --git a/calendar-cli.py b/calendar-cli.py index 3d1ca2e..198bb83 100755 --- a/calendar-cli.py +++ b/calendar-cli.py @@ -835,6 +835,7 @@ def main(): parser.add_argument("--caldav-user", help="username to log into the caldav server", metavar="USER") parser.add_argument("--caldav-pass", help="password to log into the caldav server", metavar="PASS") parser.add_argument("--caldav-proxy", help="HTTP proxy server to use (if any)") + parser.add_argument("--file-pass", help="Absolute path to file containing the password") parser.add_argument("--ssl-verify-cert", help="verification of the SSL cert - 'yes' to use the OS-provided CA-bundle, 'no' to trust any cert and the path to a CA-bundle") parser.add_argument("--debug-logging", help="turn on debug logging", action="store_true") parser.add_argument("--calendar-url", help="URL for calendar to be used (may be absolute or relative to caldav URL, or just the name of the calendar)") @@ -964,6 +965,10 @@ def main(): caldav.log.setLevel(logging.DEBUG) caldav.log.addHandler(logging.StreamHandler()) + if args.file_pass: + with open(args.file_pass, 'r') as f: + args.caldav_pass = f.read().strip() + if not args.nocaldav: if not args.calendar_url and not args.caldav_url: sys.stderr.write(""" -- cgit v1.2.3