feat: aliases

feat: add aliases to --list and --list-all flags

feat: add aliases to --summary

feat: enable aliases for included tasks

tests: added alias unit tests
This commit is contained in:
Pete Davison
2022-10-01 22:39:44 +00:00
parent d2061ec898
commit 376a6182eb
15 changed files with 183 additions and 21 deletions

View File

@@ -44,8 +44,9 @@ func (e *Executor) printTasks(listAll bool) {
// Format in tab-separated columns with a tab stop of 8.
w := tabwriter.NewWriter(e.Stdout, 0, 8, 6, ' ', 0)
for _, task := range tasks {
taskNames := append([]string{task.Task}, task.Aliases...)
e.Logger.FOutf(w, logger.Yellow, "* ")
e.Logger.FOutf(w, logger.Green, task.Task)
e.Logger.FOutf(w, logger.Green, strings.Join(taskNames, "|"))
e.Logger.FOutf(w, logger.Default, ": \t%s", task.Desc)
fmt.Fprint(w, "\n")
}