def parse_args(args):
parser = argparse.ArgumentParser(
description=DESCRIPTION,
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
'repo',
help='Github repo to export, in format "owner/repo_name".',
type=str,
action='store',
# TODO - validate this is in correct format.
)
parser.add_argument(
'outpath',
help='Path to write exported issues.',
type=str,
action='store',
)
parser.add_argument(
'-l',
'--login',
help='Prompt to login as this Github user. If provided, this takes '
'precedence over any token found in the environment. If not '
'provided and no token is found, you will be prompted to login as '
'the repository owner.',
type=str,
action='store',
dest='login_user',
)
parser.add_argument(
'-t',
'--token',
help='Automatically login with this Github API token. If --login is '
'provided, this is ignored.',
type=str,
action='store',
dest='token',
)
return parser.parse_args(args)
评论列表
文章目录