cli.py 文件源码

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

项目:python-confidant-client 作者: lyft 项目源码 文件源码
def __call__(self, parser, namespace, values, option_string=None):
        parser.print_help()
        print('')

        # retrieve subparsers from parser
        subparsers_actions = [
            action for action in parser._actions
            if isinstance(action, argparse._SubParsersAction)]
        for subparsers_action in subparsers_actions:
            # get all subparsers and print help
            for choice, subparser in subparsers_action.choices.items():
                print('Subcommand \'{0}\':'.format(choice))
                subparser.print_help()

        print(
            'example: confidant get_service -u'
            ' "https://confidant-production.example.com" -k'
            ' "alias/authnz-production" --from myservice-production'
            ' --to confidant-production --user_type service'
            ' --region us-west-2 --service myservice-production'
        )

        parser.exit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号