cmd: Add error check for Persistent Flags
This commit is contained in:
parent
04dffcc4ae
commit
ea3043cdcb
3 changed files with 12 additions and 1 deletions
|
@ -11,6 +11,10 @@ import (
|
|||
func init() {
|
||||
rootCmd.AddCommand(routesCmd)
|
||||
routesCmd.PersistentFlags().StringP("namespace", "n", "", "Namespace")
|
||||
err := routesCmd.MarkPersistentFlagRequired("namespace")
|
||||
if err != nil {
|
||||
log.Fatalf(err.Error())
|
||||
}
|
||||
routesCmd.AddCommand(listRoutesCmd)
|
||||
routesCmd.AddCommand(enableRouteCmd)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue