1
0
Fork 0
mirror of https://github.com/clockfort/GitHub-Backup.git synced 2025-03-16 00:00:06 +01:00

Merge pull request #11 from indigoid/master

add support for OAuth tokens
This commit is contained in:
Chris Lockfort 2014-07-28 22:36:17 -07:00
commit cc01c5deb0

View file

@ -27,6 +27,12 @@ def main():
config['password'] = args.password
config['login'] = args.username
# if both password and token are specified, the token will be
# used, according to pygithub3 sources
# however, the username isn't required when using a token
if (args.token):
config['token'] = args.token
gh = Github(**config)
# Get all of the given user's repos
@ -57,6 +63,7 @@ def init_parser():
parser.add_argument("-P","--prefix", help="Add prefix to repository directory names", default="")
parser.add_argument("-o","--organization", help="Backup Organizational repositories")
parser.add_argument("-S","--ssh", help="Use SSH protocol", action="store_true")
parser.add_argument("-t","--token", help="Authenticate with Github API using OAuth token", default="")
return parser