From 7077b20a547afa735dc3407b2c4c1bcddea0ee67 Mon Sep 17 00:00:00 2001
From: Andrey Nering <andrey.nering@gmail.com>
Date: Sun, 30 Jul 2017 19:24:53 -0300
Subject: [PATCH] flag to set directory of execution

---
 cmd/task/task.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cmd/task/task.go b/cmd/task/task.go
index 461aa819..2323ef1f 100644
--- a/cmd/task/task.go
+++ b/cmd/task/task.go
@@ -14,7 +14,7 @@ var (
 	version = "master"
 )
 
-const usage = `Usage: task [-ilfwvs] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [task...]
+const usage = `Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [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.
@@ -50,6 +50,7 @@ func main() {
 		watch       bool
 		verbose     bool
 		silent      bool
+		dir         string
 	)
 
 	pflag.BoolVar(&versionFlag, "version", false, "show Task version")
@@ -59,6 +60,7 @@ func main() {
 	pflag.BoolVarP(&watch, "watch", "w", false, "enables watch of the given task")
 	pflag.BoolVarP(&verbose, "verbose", "v", false, "enables verbose mode")
 	pflag.BoolVarP(&silent, "silent", "s", false, "disables echoing")
+	pflag.StringVarP(&dir, "dir", "d", "", "sets directory of execution")
 	pflag.Parse()
 
 	if versionFlag {
@@ -82,6 +84,7 @@ func main() {
 		Watch:   watch,
 		Verbose: verbose,
 		Silent:  silent,
+		Dir:     dir,
 
 		Stdin:  os.Stdin,
 		Stdout: os.Stdout,