Skip to content

Commit edcd3a6

Browse files
iwahbetehsis
authored andcommitted
SilenceUsage and SilenceErrors; using cmdutil instead
1 parent c7d7584 commit edcd3a6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmd/esc/cli/esc.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ func New(opts *Options) *cobra.Command {
101101
}
102102

103103
cmd := &cobra.Command{
104-
Use: "esc",
105-
Short: "Pulumi ESC command line",
104+
Use: "esc",
105+
Short: "Pulumi ESC command line",
106+
SilenceErrors: true,
107+
SilenceUsage: true,
106108
Long: fmt.Sprintf("Pulumi ESC - Manage environments, secrets, and configuration\n"+
107109
"\n"+
108110
"To begin working with Pulumi ESC, run the `%[1]s env init` command:\n"+

cmd/esc/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/pulumi/esc/cmd/esc/cli"
1212
"github.com/pulumi/esc/cmd/esc/cli/version"
13+
"github.com/pulumi/pulumi/sdk/v3/go/common/util/cmdutil"
1314
)
1415

1516
// panicHandler displays an emergency error message to the user and a stack trace to
@@ -43,6 +44,7 @@ func main() {
4344
return cli.New(nil).Execute()
4445
}()
4546
if err != nil {
47+
cmdutil.DisplayErrorMessage(err)
4648
os.Exit(1)
4749
}
4850
}

0 commit comments

Comments
 (0)