1
0
mirror of https://github.com/go-task/task.git synced 2024-12-14 10:52:43 +02:00

Merge pull request #35 from smyrman/print-on-set

Print on set
This commit is contained in:
Andrey Nering 2017-07-03 19:53:03 -03:00 committed by GitHub
commit a3bfa13670
2 changed files with 14 additions and 8 deletions

View File

@ -14,14 +14,14 @@ var (
version = "master"
)
func main() {
log.SetFlags(0)
const usage = `Usage: task [-ifw] [--init] [--force] [--watch] [task...]
pflag.Usage = func() {
fmt.Println(`task [target1 target2 ...]: Runs commands under targets like make.
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.
Example: 'task hello' with the following 'Taskfile.yml' file will generate an
'output.txt' file with the content "hello".
Example: 'task hello' with the following 'Taskfile.yml' file will generate
an 'output.txt' file.
'''
hello:
cmds:
@ -30,7 +30,13 @@ hello:
generates:
- output.txt
'''
`)
`
func main() {
log.SetFlags(0)
pflag.Usage = func() {
fmt.Println(usage)
pflag.PrintDefaults()
}

View File

@ -249,8 +249,8 @@ func (e *Executor) runCommand(ctx context.Context, task string, i int) error {
Stderr: e.Stderr,
}
e.println(c)
if t.Set == "" {
e.println(c)
opts.Stdout = e.Stdout
if err = execext.RunCommand(opts); err != nil {
return err