diff --git a/cmd/headscale/cli/nodes.go b/cmd/headscale/cli/nodes.go index 7a773cef..4be706b8 100644 --- a/cmd/headscale/cli/nodes.go +++ b/cmd/headscale/cli/nodes.go @@ -13,7 +13,10 @@ import ( func init () { nodeCmd.PersistentFlags().StringP("namespace", "n", "", "Namespace") - nodeCmd.MarkPersistentFlagRequired("namespace") + err := nodeCmd.MarkPersistentFlagRequired("namespace") + if err != nil { + log.Fatalf(err.Error()) + } nodeCmd.AddCommand(listNodesCmd) nodeCmd.AddCommand(registerNodeCmd) nodeCmd.AddCommand(deleteNodeCmd) diff --git a/cmd/headscale/cli/preauthkeys.go b/cmd/headscale/cli/preauthkeys.go index 8964bcfa..881b5ca3 100644 --- a/cmd/headscale/cli/preauthkeys.go +++ b/cmd/headscale/cli/preauthkeys.go @@ -13,6 +13,10 @@ import ( func init() { rootCmd.AddCommand(preauthkeysCmd) preauthkeysCmd.PersistentFlags().StringP("namespace", "n", "", "Namespace") + err := preauthkeysCmd.MarkPersistentFlagRequired("namespace") + if err != nil { + log.Fatalf(err.Error()) + } preauthkeysCmd.AddCommand(listPreAuthKeys) preauthkeysCmd.AddCommand(createPreAuthKeyCmd) createPreAuthKeyCmd.PersistentFlags().Bool("reusable", false, "Make the preauthkey reusable") diff --git a/cmd/headscale/cli/routes.go b/cmd/headscale/cli/routes.go index aa392818..98b653f9 100644 --- a/cmd/headscale/cli/routes.go +++ b/cmd/headscale/cli/routes.go @@ -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) }