mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-25 15:39:37 -05:00
Display usage when args are defined in an invalid way
This commit is contained in:
parent
4459766b58
commit
2a6b1e2277
@ -13,7 +13,7 @@ var rootCmd = &cobra.Command{
|
||||
Use: "constellation",
|
||||
Short: "Manage your Constellation cluster",
|
||||
Long: "Manage your Constellation cluster.",
|
||||
SilenceUsage: true,
|
||||
PersistentPreRun: preRunRoot,
|
||||
}
|
||||
|
||||
// Execute starts the CLI.
|
||||
@ -64,6 +64,10 @@ func init() {
|
||||
rootCmd.AddCommand(newVersionCmd())
|
||||
}
|
||||
|
||||
func preRunRoot(cmd *cobra.Command, args []string) {
|
||||
cmd.SilenceUsage = true
|
||||
}
|
||||
|
||||
func must(err error) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
Loading…
Reference in New Issue
Block a user