From 752d9d5316fefbb0a4711b5b8fc1c81d50b2353f Mon Sep 17 00:00:00 2001 From: Bruno Delor Date: Mon, 6 Jun 2022 09:46:27 +0200 Subject: [PATCH] Renames option to align with existing tools Shorthand: -x Longhand: --exit-code --- cmd/task/task.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/task/task.go b/cmd/task/task.go index 6fa404e3..3c0fc609 100644 --- a/cmd/task/task.go +++ b/cmd/task/task.go @@ -68,7 +68,7 @@ func main() { silent bool dry bool summary bool - carryErr bool + exitCode bool parallel bool concurrency int dir string @@ -90,7 +90,7 @@ func main() { pflag.BoolVarP(¶llel, "parallel", "p", false, "executes tasks provided on command line in parallel") pflag.BoolVar(&dry, "dry", false, "compiles and prints tasks in the order that they would be run, without executing them") pflag.BoolVar(&summary, "summary", false, "show summary about a task") - pflag.BoolVar(&carryErr, "carry", false, "carry error code if any") + pflag.BoolVarP(&exitCode, "exit-code", "x", false, "pass-through the exit code of the task command") pflag.StringVarP(&dir, "dir", "d", "", "sets directory of execution") pflag.StringVarP(&entrypoint, "taskfile", "t", "", `choose which Taskfile to run. Defaults to "Taskfile.yml"`) pflag.StringVarP(&output.Name, "output", "o", "", "sets output style: [interleaved|group|prefixed]") @@ -219,7 +219,7 @@ func main() { if err := e.Run(ctx, calls...); err != nil { e.Logger.Errf(logger.Red, "%v", err) code := 1 - if carryErr { + if exitCode { if tre, ok := err.(*task.TaskRunError); ok { code = tre.ExitCode() }