mirror of
https://github.com/go-task/task.git
synced 2025-06-23 00:38:19 +02:00
Use github.com/spf13/pflag instead of stdlib flag
This commit is contained in:
6
task.go
6
task.go
@ -3,7 +3,6 @@ package task
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
@ -11,6 +10,7 @@ import (
|
||||
"os/exec"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/spf13/pflag"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
@ -22,7 +22,7 @@ var (
|
||||
// ShPath constains the Bash path if found
|
||||
ShPath string
|
||||
|
||||
// Force (-f flag) forces a task to run even when it's up-to-date
|
||||
// Force (--force or -f flag) forces a task to run even when it's up-to-date
|
||||
Force bool
|
||||
|
||||
// Tasks constains the tasks parsed from Taskfile
|
||||
@ -68,7 +68,7 @@ func (err *taskRunError) Error() string {
|
||||
func Run() {
|
||||
log.SetFlags(0)
|
||||
|
||||
args := flag.Args()
|
||||
args := pflag.Args()
|
||||
if len(args) == 0 {
|
||||
log.Fatal("No argument given")
|
||||
}
|
||||
|
Reference in New Issue
Block a user