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)
评论列表
文章目录