Skip to content

Commit

Permalink
feat: alias -t and -T to --list and --list-all (#125)
Browse files Browse the repository at this point in the history
## Description

This adds `-t` and `-T` aliases to Maru task listing flags.

## Related Issue

Relates to defenseunicorns/uds-cli#776

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [X] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/maru-runner/blob/main/CONTRIBUTING.md)
followed
  • Loading branch information
Racer159 committed Jul 12, 2024
1 parent 84cf2f7 commit 1c82388
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ var runCmd = &cobra.Command{
for _, task := range tasksFile.Tasks {
rows = append(rows, []string{task.Name, task.Description})
}

// If ListAllTasks, add tasks from included files
if listAllTasks {
err = listTasksFromIncludes(&rows, tasksFile)
Expand Down Expand Up @@ -200,7 +201,7 @@ func init() {
rootCmd.AddCommand(runCmd)
runFlags := runCmd.Flags()
runFlags.StringVarP(&config.TaskFileLocation, "file", "f", config.TasksYAML, lang.CmdRunFlag)
runFlags.BoolVar(&listTasks, "list", false, lang.CmdRunList)
runFlags.BoolVar(&listAllTasks, "list-all", false, lang.CmdRunListAll)
runFlags.BoolVarP(&listTasks, "list", "t", false, lang.CmdRunList)
runFlags.BoolVarP(&listAllTasks, "list-all", "T", false, lang.CmdRunListAll)
runFlags.StringToStringVar(&setRunnerVariables, "set", nil, lang.CmdRunSetVarFlag)
}

0 comments on commit 1c82388

Please sign in to comment.