From 13614fb3c4b2a4a8019b40c9d6fd1e771a270fb2 Mon Sep 17 00:00:00 2001 From: jaedle Date: Sun, 24 Feb 2019 08:51:20 +0100 Subject: [PATCH] add details flag for cli --- cmd/task/task.go | 5 ++++- task.go | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/task/task.go b/cmd/task/task.go index 694a0a5c..4140c5d7 100644 --- a/cmd/task/task.go +++ b/cmd/task/task.go @@ -17,7 +17,7 @@ var ( version = "master" ) -const usage = `Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [--dry] [task...] +const usage = `Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [--dry] [--details] [task...] Runs the specified task(s). Falls back to the "default" task if no task name was specified, or lists all tasks if an unknown task name was specified. @@ -56,6 +56,7 @@ func main() { verbose bool silent bool dry bool + details bool dir string output string ) @@ -69,6 +70,7 @@ func main() { pflag.BoolVarP(&verbose, "verbose", "v", false, "enables verbose mode") pflag.BoolVarP(&silent, "silent", "s", false, "disables echoing") pflag.BoolVar(&dry, "dry", false, "compiles and prints tasks in the order that they would be run, without executing them") + pflag.BoolVar(&details, "details", false, "show detailed description about a task if present") pflag.StringVarP(&dir, "dir", "d", "", "sets directory of execution") pflag.StringVarP(&output, "output", "o", "", "sets output style: [interleaved|group|prefixed]") pflag.Parse() @@ -96,6 +98,7 @@ func main() { Silent: silent, Dir: dir, Dry: dry, + Details: details, Stdin: os.Stdin, Stdout: os.Stdout, diff --git a/task.go b/task.go index 1632d6d6..8b222c84 100644 --- a/task.go +++ b/task.go @@ -36,6 +36,7 @@ type Executor struct { Verbose bool Silent bool Dry bool + Details bool Stdin io.Reader Stdout io.Writer