File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,11 @@ def main():
1616 Main function primarly used for the command line interface
1717 """
1818 parser = argparse .ArgumentParser (prog = "pyauthenticator" )
19+ config_dict = load_config ()
1920 parser .add_argument (
2021 "service" ,
2122 help = "Service to generate optauth code for. Available services are: "
22- + str (list_services (config_dict = load_config () )),
23+ + str (list_services (config_dict = config_dict )),
2324 )
2425 parser .add_argument (
2526 "-qr" ,
@@ -34,14 +35,15 @@ def main():
3435 )
3536 args = parser .parse_args ()
3637 if args .qrcode :
37- generate_qrcode (key = args .service , config_dict = load_config () )
38+ generate_qrcode (key = args .service , config_dict = config_dict )
3839 elif args .add :
3940 add_service (
40- key = args .service , qrcode_png_file_name = args .add , config_dict = load_config ()
41+ key = args .service , qrcode_png_file_name = args .add , config_dict = config_dict
4142 )
4243 print (args .service , "added." )
4344 else :
44- print (get_two_factor_code (key = args .service , config_dict = load_config () ))
45+ print (get_two_factor_code (key = args .service , config_dict = config_dict ))
4546
4647
47- main ()
48+ if __name__ == "__main__" :
49+ main ()
You can’t perform that action at this time.
0 commit comments