mirror of
				https://github.com/luscis/openlan.git
				synced 2025-10-31 04:26:21 +08:00 
			
		
		
		
	fea: ipsec tunnel cli.
This commit is contained in:
		| @@ -1,7 +1,6 @@ | ||||
| package v5 | ||||
|  | ||||
| import ( | ||||
| 	"github.com/luscis/openlan/cmd/api" | ||||
| 	"github.com/luscis/openlan/pkg/schema" | ||||
| 	"github.com/urfave/cli/v2" | ||||
| ) | ||||
| @@ -34,7 +33,7 @@ func (u Point) List(c *cli.Context) error { | ||||
| 	if err := clt.GetJSON(url, &items); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	name := c.String("network") | ||||
| 	name := c.String("name") | ||||
| 	if len(name) > 0 { | ||||
| 		tmp := items[:0] | ||||
| 		for _, obj := range items { | ||||
| @@ -47,21 +46,17 @@ func (u Point) List(c *cli.Context) error { | ||||
| 	return u.Out(items, c.String("format"), u.Tmpl()) | ||||
| } | ||||
|  | ||||
| func (u Point) Commands(app *api.App) { | ||||
| 	app.Command(&cli.Command{ | ||||
| 		Name:    "point", | ||||
| 		Aliases: []string{"ap"}, | ||||
| 		Usage:   "Point accessed to switch", | ||||
| func (u Point) Commands() *cli.Command { | ||||
| 	return &cli.Command{ | ||||
| 		Name:  "point", | ||||
| 		Usage: "Point accessed to switch", | ||||
| 		Subcommands: []*cli.Command{ | ||||
| 			{ | ||||
| 				Name:    "list", | ||||
| 				Usage:   "Display all points", | ||||
| 				Aliases: []string{"ls"}, | ||||
| 				Flags: []cli.Flag{ | ||||
| 					&cli.StringFlag{Name: "network"}, | ||||
| 				}, | ||||
| 				Action: u.List, | ||||
| 				Action:  u.List, | ||||
| 			}, | ||||
| 		}, | ||||
| 	}) | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Daniel Ding
					Daniel Ding