Skip to content

Commit

Permalink
Removing unnecessary usage printing on errors which are not related
Browse files Browse the repository at this point in the history
  • Loading branch information
GPaulH committed Aug 6, 2024
1 parent 7a7baaa commit 696da7a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/mconnect/commands/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ By default it will be assumed that the project and region used for Migration Cen
return messages.NoArgumentsAcceptedError{Args: args}.Error()
}

// Remove usage printing on error once initial parameter validations are done.
cmd.SilenceUsage = true

if datasetID == "" {
datasetID = defaultDatasetID
}
Expand Down
3 changes: 3 additions & 0 deletions tools/mconnect/commands/groups/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ func NewCreateGroupsCmd(factory groupCreatorFactory) *cobra.Command {
return messages.NoArgumentsAcceptedError{Args: args}.Error()
}

// Remove usage printing on error once initial parameter validations are done.
cmd.SilenceUsage = true

fmt.Println(messages.ParsingFile{FilePath: path})
groups, err := parser.Groups(path)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions tools/mconnect/commands/views/views.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ mconnect create-views --project=my-project-id --dataset=dataset-id --force=true`
return messages.NoArgumentsAcceptedError{Args: args}.Error()
}

// Remove usage printing on error once initial parameter validations are done.
cmd.SilenceUsage = true

vc := factory.build(projectID, datasetID)
viewsMetadata := []viewMetadata{
newViewMetadata(mcViewName, "mc view description", mcQuery(projectID, datasetID)),
Expand Down

0 comments on commit 696da7a

Please # to comment.