Skip to content

Commit

Permalink
Refactor routes cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
ohdearaugustin committed Jul 25, 2021
1 parent e56755f commit d87a4c8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cmd/headscale/cli/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ import (
"github.com/spf13/cobra"
)

var RoutesCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(routesCmd)
routesCmd.PersistentFlags().StringP("namespace", "n", "", "Namespace")
routesCmd.AddCommand(listRoutesCmd)
routesCmd.AddCommand(enableRouteCmd)
}

var routesCmd = &cobra.Command{
Use: "routes",
Short: "Manage the routes of Headscale",
}

var ListRoutesCmd = &cobra.Command{
var listRoutesCmd = &cobra.Command{
Use: "list NODE",
Short: "List the routes exposed by this node",
Args: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -49,7 +56,7 @@ var ListRoutesCmd = &cobra.Command{
},
}

var EnableRouteCmd = &cobra.Command{
var enableRouteCmd = &cobra.Command{
Use: "enable node-name route",
Short: "Allows exposing a route declared by this node to the rest of the nodes",
Args: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit d87a4c8

Please sign in to comment.