def login(args): """ Log into a GitHub instance, and print the resulting OAuth token. """ with cli.catch_api_errors(): client = GithubAPIClient(nickname=args.github) login_if_needed(client, args.scope, comment=args.comment) oauth_token_key = envkey(client.nickname, 'oauth_token') print("export {0}='{1}'".format(oauth_token_key, client.token))
def login(args): """ Log into a GitHub instance, and print the resulting OAuth token. """ with cli.catch_api_errors(): client = GithubAPIClient(nickname=args.github) login_if_needed(client, args.scope, comment=args.comment) oauth_token_key = envkey(client.nickname, "oauth_token") print("export {0}='{1}'".format(oauth_token_key, client.token))
def test_envkey(): assert_equal(envkey('foo', 'bar'), 'GITHUB_FOO_BAR') assert_equal(envkey('foo', 'baz_bat'), 'GITHUB_FOO_BAZ_BAT')