Last active
June 2, 2018 11:36
-
-
Save jamesstidard/6c5118f3b09a551f6212f08d7e466bab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
@click.command() | |
def login(): | |
password = click.prompt('Password: ', hide_input=True) | |
session_token = ''.join(reversed(password)) # exchange password for session token in some way | |
click.echo('export MY_SESSION_TOKEN="{}"'.format(session_token)) | |
if __name__ == '__main__': | |
login() | |
# Called from bash with: eval $(python click-login.py) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment