The oauth2client library defines a method called run_flow. From run_flow's documentation, run_flow allows certain CLI flags to be specified through an arg parser internal to oauth's tool's package. These flags are:
--auth_host_name (string, default: localhost)
Host name to use when running a local web server to handle redirects during OAuth authorization.
--auth_host_port (integer, default: [8080, 8090])
Port to use when running a local web server to handle redirects during
OAuth authorization. Repeat this option to specify a list of values.
--[no]auth_local_webserver (boolean, default: True)
Run a local web server to handle redirects during OAuth authorization.
However, these flags are an issue for me because my program makes extensive use of flags I defined myself through a different argument parser instance, and those flags conflict with oauth's. This collision generates this error:
usage: main.py [--auth_host_name AUTH_HOST_NAME] [--noauth_local_webserver]
[--auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]]
[--logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
main.py: error: unrecognized arguments: --students student_names_here
I looked at using tools.init from this similar stack overflow post: Using Argparse with Google Admin API
I couldn't find tools.init documentation, and so it may be deprecated. How can I use my cli flags without them conflicting with oauth run_flow's internal argparser?