cli.py 文件源码

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

项目:stl 作者: pavelsof 项目源码 文件源码
def _init_switch(self):
        """
        Inits the subparser that handles the switch command.
        """
        def switch(core, args):
            task = ' '.join(args.task) if args.task else ''
            return core.switch(task=task)

        usage = 'stl switch [task]'
        desc = (
            'shortcut for stl stop && stl start; '
            'stop the current task and immediately start another one'
        )

        subp = self.subparsers.add_parser('switch', usage=usage,
            description=desc, help=desc[:desc.find(';')])

        subp.add_argument('task', nargs=argparse.REMAINDER,
            help='the task that you are about to start working on')

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


问题


面经


文章

微信
公众号

扫码关注公众号