Skip to content

Commit 6fcce27

Browse files
committed
refactor PreRun so argument required checks can happen first
1 parent 1c24a51 commit 6fcce27

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/cli/clu2adv/clu2adv.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ func Builder() *cobra.Command {
99
o := &opts{fs: afero.NewOsFs()}
1010
cmd := &cobra.Command{
1111
Use: "clusterToAdvancedCluster",
12-
Short: "Convert cluster to advanced_cluster",
13-
Long: "Convert a Terraform configuration from mongodbatlas_cluster to mongodbatlas_advanced_cluster",
12+
Short: "Convert cluster to advanced_cluster v2",
13+
Long: "Convert a Terraform configuration from mongodbatlas_cluster to mongodbatlas_advanced_cluster schema v2",
1414
Aliases: []string{"clu2adv"},
15-
PreRunE: func(cmd *cobra.Command, args []string) error {
16-
return o.PreRun()
17-
},
1815
RunE: func(_ *cobra.Command, _ []string) error {
16+
if err := o.PreRun(); err != nil {
17+
return err
18+
}
1919
return o.Run()
2020
},
2121
}

0 commit comments

Comments
 (0)