Skip to content

Commit

Permalink
Merge pull request #20 from dnephin/add-vendor
Browse files Browse the repository at this point in the history
Fix vendor, update to new spf13/pflag behaviour
  • Loading branch information
dnephin committed Aug 4, 2018
2 parents c6598a9 + 415233f commit 0267de5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
dep ensure
docker cp \
deps-$CIRCLE_BUILD_NUM:/go/src/gotest.tools/gotestsum/vendor \
vendor
.
- run:
name: "Lint"
command: |
Expand Down
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[prune]
non-go = true
go-tests = true
unused-packages = true

[[constraint]]
name = "github.com/google/go-cmp"
Expand All @@ -15,11 +19,6 @@
name = "github.com/spf13/pflag"
version = "1.0.0"

[prune]
non-go = true
go-tests = true
unused-packages = true

[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.5"
Expand Down
11 changes: 10 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ import (
func main() {
name := os.Args[0]
flags, opts := setupFlags(name)
if err := flags.Parse(os.Args[1:]); err != nil {
switch err := flags.Parse(os.Args[1:]); {
case err == pflag.ErrHelp:
os.Exit(0)
case err != nil:
log.Error(err.Error())
flags.Usage()
os.Exit(1)
}
opts.args = flags.Args()
Expand Down Expand Up @@ -173,6 +178,10 @@ type proc struct {
}

func startGoTest(ctx context.Context, args []string) (proc, error) {
if len(args) == 0 {
return proc{}, errors.New("missing command to run")
}

ctx, cancel := context.WithCancel(ctx)
p := proc{
cmd: exec.CommandContext(ctx, args[0], args[1:]...),
Expand Down

0 comments on commit 0267de5

Please sign in to comment.