cli.py 文件源码

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

项目:stl 作者: pavelsof 项目源码 文件源码
def _init_edit(self):
        """
        Inits the subparser that handles the edit command.
        """
        def edit(core, args):
            month = ' '.join(getattr(args, 'month', []))
            core.edit(month)

        usage = 'stl edit [month]'
        desc = (
            'lets you vim the right file'
        )

        subp = self.subparsers.add_parser('edit', usage=usage,
            description=desc, help=desc)

        subp.add_argument('month', nargs=argparse.REMAINDER,
            help='the month you want to edit, e.g. oct 2016')

        subp.set_defaults(func=edit)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号