Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded message on command completion. Set error output to Stderr #432

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmd/imgpkg/imgpkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"
"time"

"github.com/cppforlife/cobrautil"
uierrs "github.com/cppforlife/go-cli-ui/errors"
"github.com/cppforlife/go-cli-ui/ui"
"github.com/vmware-tanzu/carvel-imgpkg/pkg/imgpkg/cmd"
Expand Down Expand Up @@ -40,6 +41,7 @@ func main() {
confUI.ErrorLinef("imgpkg: Error: %v", uierrs.NewMultiLineError(err))
os.Exit(1)
}

confUI.PrintLinef("Succeeded")
if !cobrautil.IsCobraManagedCommand(os.Args) {
confUI.PrintLinef("Succeeded")
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220517224237-e6f29200ae04
github.com/cheggaaa/pb/v3 v3.0.8
github.com/chrismellard/docker-credential-acr-env v0.0.0-20220327082430-c57b701bfc08
github.com/cppforlife/cobrautil v0.0.0-20200514214827-bb86e6965d72
github.com/cppforlife/cobrautil v0.0.0-20221021151949-d60711905d65
github.com/cppforlife/go-cli-ui v0.0.0-20220425131040-94f26b16bc14
github.com/fatih/color v1.13.0 // indirect
github.com/google/go-containerregistry v0.11.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cppforlife/cobrautil v0.0.0-20200514214827-bb86e6965d72 h1:rPWcUBgMb1ox2eCohCuZ8gsZVe0aB5qBbYaBpdoxfCE=
github.com/cppforlife/cobrautil v0.0.0-20200514214827-bb86e6965d72/go.mod h1:2w+qxVu2KSGW78Ex/XaIqfh/OvBgjEsmN53S4T8vEyA=
github.com/cppforlife/cobrautil v0.0.0-20221021151949-d60711905d65 h1:+3J1K6yQFRPKDEl5Py68c1q0FjaCkeMcB1nb7uzmpSw=
github.com/cppforlife/cobrautil v0.0.0-20221021151949-d60711905d65/go.mod h1:2w+qxVu2KSGW78Ex/XaIqfh/OvBgjEsmN53S4T8vEyA=
github.com/cppforlife/color v1.9.1-0.20200716202919-6706ac40b835 h1:mYQweUIBD+TBRjIeQnJmXr0GSVMpI6O0takyb/aaOgo=
github.com/cppforlife/color v1.9.1-0.20200716202919-6706ac40b835/go.mod h1:dYeVsKp1vvK8XjdTPR1gF+uk+9doxKeO3hqQTOCr7T4=
github.com/cppforlife/go-cli-ui v0.0.0-20220425131040-94f26b16bc14 h1:MjRdR01xh0sfkeS3OOBv+MYkYsrbHuTDc4rfBnVdFaI=
Expand Down
3 changes: 2 additions & 1 deletion pkg/imgpkg/cmd/imgpkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package cmd

import (
"io"
"os"

"github.com/cppforlife/cobrautil"
"github.com/cppforlife/go-cli-ui/ui"
Expand Down Expand Up @@ -40,7 +41,7 @@ func NewImgpkgCmd(o *ImgpkgOptions) *cobra.Command {
// setting output for cmd.Help()
blockWriter := uiBlockWriter{o.ui}
cmd.SetOut(blockWriter)
cmd.SetErr(blockWriter)
cmd.SetErr(os.Stderr)

o.UIFlags.Set(cmd)
o.DebugFlags.Set(cmd)
Expand Down
23 changes: 21 additions & 2 deletions vendor/github.com/cppforlife/cobrautil/misc.go

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ github.com/chrismellard/docker-credential-acr-env/pkg/token
## explicit; go 1.16
github.com/containerd/stargz-snapshotter/estargz
github.com/containerd/stargz-snapshotter/estargz/errorutil
# github.com/cppforlife/cobrautil v0.0.0-20200514214827-bb86e6965d72
# github.com/cppforlife/cobrautil v0.0.0-20221021151949-d60711905d65
## explicit
github.com/cppforlife/cobrautil
# github.com/cppforlife/color v1.9.1-0.20200716202919-6706ac40b835
Expand Down