mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-13 08:29:38 -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",
|
Use: "constellation",
|
||||||
Short: "Manage your Constellation cluster",
|
Short: "Manage your Constellation cluster",
|
||||||
Long: "Manage your Constellation cluster.",
|
Long: "Manage your Constellation cluster.",
|
||||||
SilenceUsage: true,
|
PersistentPreRun: preRunRoot,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute starts the CLI.
|
// Execute starts the CLI.
|
||||||
@ -64,6 +64,10 @@ func init() {
|
|||||||
rootCmd.AddCommand(newVersionCmd())
|
rootCmd.AddCommand(newVersionCmd())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func preRunRoot(cmd *cobra.Command, args []string) {
|
||||||
|
cmd.SilenceUsage = true
|
||||||
|
}
|
||||||
|
|
||||||
func must(err error) {
|
func must(err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user