gh2md.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:gh2md 作者: mattduck 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号