Add ablity to retrieve repositores owned by organization.

This commit is contained in:
Kamil Winczek 2013-10-03 15:51:18 +01:00
parent 9887a96b9f
commit aeb29a9ebc

View file

@ -30,7 +30,11 @@ def main():
gh = Github(**config)
# Get all of the given user's repos
user_repos = gh.repos.list().all()
if args.organization:
user_repos = gh.repos.list_by_org(args.organization).all()
else:
user_repos = gh.repos.list().all()
for repo in user_repos:
repo.user = gh.users.get(repo.owner.login)
process_repo(repo, args)
@ -50,6 +54,7 @@ def init_parser():
parser.add_argument("-g","--git", help="Pass extra arguments to git", default="", metavar="ARGS")
parser.add_argument("-s", "--suffix", help="Add suffix to repository directory names", default="")
parser.add_argument("-p", "--password", help="Authenticate with Github API")
parser.add_argument("-o","--organization", help="Backup Organizational repositories")
return parser