diff --git a/cmd/task/task.go b/cmd/task/task.go index b71ccf0c..067bb3da 100644 --- a/cmd/task/task.go +++ b/cmd/task/task.go @@ -50,6 +50,7 @@ func main() { var ( versionFlag bool + helpFlag bool init bool list bool status bool @@ -66,6 +67,7 @@ func main() { ) pflag.BoolVar(&versionFlag, "version", false, "show Task version") + pflag.BoolVarP(&helpFlag, "help", "h", false, "shows Task usage") pflag.BoolVarP(&init, "init", "i", false, "creates a new Taskfile.yml in the current folder") pflag.BoolVarP(&list, "list", "l", false, "lists tasks with description of current Taskfile") pflag.BoolVar(&status, "status", false, "exits with non-zero exit code if any of the given tasks is not up-to-date") @@ -86,6 +88,11 @@ func main() { return } + if helpFlag { + pflag.Usage() + return + } + if init { wd, err := os.Getwd() if err != nil {