1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

feat (help): allow cli option to list tasks with no desc

added an add'l cli option that lists all tasks, with or without description.
orig. behavior: task -l lists tasks with desc field
new behaviour: task -la or task -a will list all tasks. if task has desc, it will be included.

BREAKING CHANGES: none, that I know of.
NOTES/Concerns:
- This is wip.
- Haven't checked how it interacts with bash completion.
- The new Executor.TaskNames func does not use e.CompiledTask(taskfile.Call{Task: task.Task})
This commit is contained in:
Kevin Ard
2020-11-13 15:27:03 -05:00
parent b136166fc9
commit 9bed7f7a9b
3 changed files with 28 additions and 6 deletions

View File

@@ -64,7 +64,9 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
for _, c := range calls {
if _, ok := e.Taskfile.Tasks[c.Task]; !ok {
// FIXME: move to the main package
e.PrintTasksHelp()
// FIXME: (ard.kevin.84@gmail.com) changed the PrintTasksHelp signature to support show all/some.
// False preserves original behavior, but should be reviewed.
e.PrintTasksHelp(false)
return &taskNotFoundError{taskName: c.Task}
}
}