summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Brand <gb@unistra.fr>2021-11-09 13:08:09 +0100
committerGuy Brand <gb@unistra.fr>2021-11-09 13:08:09 +0100
commitd3b199be6dfd6b0083050478c3879363a567eea9 (patch)
treec6e21191f2a54fc21eeebeeb46f751248eeec45a
parent7c3b20db5754f30405db06d929dd0e3009096995 (diff)
downloadcalendar-cli-d3b199be6dfd6b0083050478c3879363a567eea9.zip
Get password from a file
-rwxr-xr-xcalendar-cli.py5
1 files changed, 5 insertions, 0 deletions
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("""