Skip to content

Commit 6a8da03

Browse files
committed
fix: output ls.
1 parent 5f8fb5d commit 6a8da03

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

cmd/api/v5/cmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package v5
22

33
import (
4-
"io/ioutil"
4+
"os"
55
"strings"
66

77
"github.com/luscis/openlan/cmd/api"
@@ -12,7 +12,7 @@ func Before(c *cli.Context) error {
1212
token := c.String("token")
1313
if token == "" {
1414
tokenFile := api.AdminTokenFile
15-
if data, err := ioutil.ReadFile(tokenFile); err == nil {
15+
if data, err := os.ReadFile(tokenFile); err == nil {
1616
token = strings.TrimSpace(string(data))
1717
}
1818
_ = c.Set("token", token)

cmd/api/v5/output.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ func (o Output) List(c *cli.Context) error {
7878

7979
func (o Output) Commands() *cli.Command {
8080
return &cli.Command{
81-
Name: "output",
82-
Usage: "Output links",
81+
Name: "output",
82+
Usage: "Output links",
83+
Action: o.List,
8384
Subcommands: []*cli.Command{
8485
{
8586
Name: "add",
@@ -88,7 +89,7 @@ func (o Output) Commands() *cli.Command {
8889
&cli.StringFlag{Name: "remote", Required: true},
8990
&cli.StringFlag{Name: "fallback"},
9091
&cli.IntFlag{Name: "segment"},
91-
&cli.StringFlag{Name: "protocol"},
92+
&cli.StringFlag{Name: "protocol", Value: "vxlan"},
9293
&cli.StringFlag{Name: "dstport"},
9394
&cli.StringFlag{Name: "secret"},
9495
&cli.StringFlag{Name: "crypt"},

0 commit comments

Comments
 (0)