Closed EvanKirshenbaum closed 5 months ago
This issue was referenced by the following commit before migration:
I decided against including an only_task()
method. You either pass a Task
to __init__()
(and have no subtasks) or add Task
s one by one with add_task()
.
The current
Exerciser
framework requires the user to specify a task name before the arguments, e.g.,There are times when you want a script to unconditionally run a single task, and it would be more user-friendly if the task didn't have to be specified.
Telling the
Exerciser
about its tasks is done inI think it should be possible to simply pull out the set-up:
and then add
probably with some checks to make sure that
add_task()
hasn't been called and won't be called.As an alternative, it may be worthwhile to have the
Exerciser
's constructor take an optionalTask
argument which, if present, will be used as its only task. The advantage to this is that it means thatadd_subparsers
won't be called, which is probably a requirement, as having it there may well confuse things.Migrated from internal repository. Originally created by @EvanKirshenbaum on Jun 16, 2022 at 10:18 AM PDT. Closed on Jun 16, 2022 at 11:01 AM PDT.