-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some cli_utils helpers. #59
Conversation
r? @almet |
return auth | ||
|
||
|
||
def client_from_args(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_client_from_args
def client_from_args(args): | ||
"""Return a client from parser args.""" | ||
return Client(server_url=args.server, | ||
auth=get_auth(args.auth), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably call get_auth at the same time we get the options. Not sure if it's possible to do it via argparse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can probably be done with https://docs.python.org/3/library/argparse.html#argparse.Action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relevant stack overflow response.
Yay! I like it :-) |
nit: mentions in docs ? |
Revamp of #34