From: Luke Kenneth Casson Leighton Date: Mon, 29 Nov 2021 20:48:38 +0000 (+0000) Subject: add username and password commandline opts to budget-sync X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66276d036e9321e7557e7105996f9b7770f036a9;p=utils.git add username and password commandline opts to budget-sync --- diff --git a/src/budget_sync/main.py b/src/budget_sync/main.py index 258e0a5..c8929af 100644 --- a/src/budget_sync/main.py +++ b/src/budget_sync/main.py @@ -23,6 +23,8 @@ def main(): help="The path to the output directory, will be created if it " "doesn't exist", dest="output_dir", metavar="") + parser.add_argument('--username', help="Log in with this username") + parser.add_argument('--password', help="Log in with this password") args = parser.parse_args() try: with args.config as config_file: @@ -32,6 +34,9 @@ def main(): return logging.info("Using Bugzilla instance at %s", config.bugzilla_url) bz = Bugzilla(config.bugzilla_url) + if args.username: + logging.debug("logging in...") + bz.interactive_login(args.username, args.password) logging.debug("Connected to Bugzilla") budget_graph = BudgetGraph(all_bugs(bz), config) for error in budget_graph.get_errors():