mirror of
https://github.com/luscis/openlan.git
synced 2026-04-22 23:07:11 +08:00
fix: output ls.
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
package v5
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/luscis/openlan/cmd/api"
|
||||
@@ -12,7 +12,7 @@ func Before(c *cli.Context) error {
|
||||
token := c.String("token")
|
||||
if token == "" {
|
||||
tokenFile := api.AdminTokenFile
|
||||
if data, err := ioutil.ReadFile(tokenFile); err == nil {
|
||||
if data, err := os.ReadFile(tokenFile); err == nil {
|
||||
token = strings.TrimSpace(string(data))
|
||||
}
|
||||
_ = c.Set("token", token)
|
||||
|
||||
@@ -78,8 +78,9 @@ func (o Output) List(c *cli.Context) error {
|
||||
|
||||
func (o Output) Commands() *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "output",
|
||||
Usage: "Output links",
|
||||
Name: "output",
|
||||
Usage: "Output links",
|
||||
Action: o.List,
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "add",
|
||||
@@ -88,7 +89,7 @@ func (o Output) Commands() *cli.Command {
|
||||
&cli.StringFlag{Name: "remote", Required: true},
|
||||
&cli.StringFlag{Name: "fallback"},
|
||||
&cli.IntFlag{Name: "segment"},
|
||||
&cli.StringFlag{Name: "protocol"},
|
||||
&cli.StringFlag{Name: "protocol", Value: "vxlan"},
|
||||
&cli.StringFlag{Name: "dstport"},
|
||||
&cli.StringFlag{Name: "secret"},
|
||||
&cli.StringFlag{Name: "crypt"},
|
||||
|
||||
Reference in New Issue
Block a user