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

feat: completion command (#1157)

This commit is contained in:
Pete Davison
2024-09-02 20:21:53 +01:00
committed by GitHub
parent d727ef5393
commit 3747b2ab7f
5 changed files with 130 additions and 46 deletions

View File

@@ -38,6 +38,7 @@ var (
Version bool
Help bool
Init bool
Completion string
List bool
ListAll bool
ListJson bool
@@ -80,6 +81,7 @@ func init() {
pflag.BoolVar(&Version, "version", false, "Show Task version.")
pflag.BoolVarP(&Help, "help", "h", false, "Shows Task usage.")
pflag.BoolVarP(&Init, "init", "i", false, "Creates a new Taskfile.yml in the current folder.")
pflag.StringVar(&Completion, "completion", "", "Generates shell completion script.")
pflag.BoolVarP(&List, "list", "l", false, "Lists tasks with description of current Taskfile.")
pflag.BoolVarP(&ListAll, "list-all", "a", false, "Lists tasks with or without a description.")
pflag.BoolVarP(&ListJson, "json", "j", false, "Formats task list as JSON.")