Skip to content

Commit 3128f82

Browse files
committed
fix(shared): do not show usage on missing credentials error
1 parent b769781 commit 3128f82

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
### Fixed
10+
- Do not display usage if execution fails because of missing credentials
911

1012
## [1.2.0] - 2022-04-29
1113
### Added

internal/commands/command.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ func BuildCommand(child Command, parent *cobra.Command, config *config.Config) C
107107

108108
service, err := config.CreateService()
109109
if err != nil {
110+
// Error was caused by missing credentials, not incorrect command
111+
child.Cobra().SilenceUsage = true
112+
110113
return fmt.Errorf("cannot create service: %w", err)
111114
}
112115
return commandRunE(child, service, config, args)

0 commit comments

Comments
 (0)