1
0
mirror of https://github.com/go-task/task.git synced 2025-01-08 04:04:08 +02:00

Renames option to align with existing tools

Shorthand: -x
Longhand: --exit-code
This commit is contained in:
Bruno Delor 2022-06-06 09:46:27 +02:00
parent 58c7cc5d05
commit 752d9d5316

View File

@ -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(&parallel, "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()
}