Skip to content

Commit

Permalink
Fail on incomplete command
Browse files Browse the repository at this point in the history
  • Loading branch information
strokyl committed Mar 20, 2024
1 parent 252f186 commit c4722bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import (
var getCmd = &cobra.Command{
Use: "get",
Short: "get resource of a given kind",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
// Root command does nothing
cmd.Help()
os.Exit(1)
},
}

var getCmdWhenNoSchema = &cobra.Command{
Expand Down
5 changes: 5 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ You can also use the CDK_KEY,CDK_CERT instead of --key and --cert flags to use a
apiClient.ActivateDebug()
}
},
Run: func(cmd *cobra.Command, args []string) {
// Root command does nothing
cmd.Help()
os.Exit(1)
},
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
Expand Down

0 comments on commit c4722bc

Please sign in to comment.