Skip to content

Commit

Permalink
fix: cmd: remove short alias.
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldin95 committed Sep 1, 2024
1 parent 8a342ec commit 8377782
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 32 deletions.
8 changes: 4 additions & 4 deletions cmd/api/v5/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package v5

import (
"fmt"
"path/filepath"

"github.com/luscis/openlan/cmd/api"
"github.com/luscis/openlan/pkg/config"
"github.com/luscis/openlan/pkg/libol"
"github.com/luscis/openlan/pkg/schema"
"github.com/urfave/cli/v2"
"path/filepath"
)

type Config struct {
Expand Down Expand Up @@ -188,9 +189,8 @@ func (u Config) Save(c *cli.Context) error {

func (u Config) Commands(app *api.App) {
app.Command(&cli.Command{
Name: "config",
Aliases: []string{"cfg"},
Usage: "Switch configuration",
Name: "config",
Usage: "Switch configuration",
Subcommands: []*cli.Command{
{
Name: "list",
Expand Down
5 changes: 2 additions & 3 deletions cmd/api/v5/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ func (u Device) List(c *cli.Context) error {

func (u Device) Commands(app *api.App) {
app.Command(&cli.Command{
Name: "device",
Aliases: []string{"dev"},
Usage: "linux network device",
Name: "device",
Usage: "linux network device",
Subcommands: []*cli.Command{
{
Name: "list",
Expand Down
5 changes: 2 additions & 3 deletions cmd/api/v5/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ func (u Lease) List(c *cli.Context) error {

func (u Lease) Commands(app *api.App) {
app.Command(&cli.Command{
Name: "lease",
Aliases: []string{"le"},
Usage: "DHCP address lease",
Name: "lease",
Usage: "Address lease",
Subcommands: []*cli.Command{
{
Name: "list",
Expand Down
7 changes: 3 additions & 4 deletions cmd/api/v5/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ func (u Network) Save(c *cli.Context) error {

func (u Network) Commands(app *api.App) {
app.Command(&cli.Command{
Name: "network",
Aliases: []string{"net"},
Name: "network",
Flags: []cli.Flag{
&cli.StringFlag{Name: "name", Value: ""},
},
Expand All @@ -110,13 +109,13 @@ func (u Network) Commands(app *api.App) {
},
{
Name: "remove",
Usage: "Remove the network",
Usage: "Remove a network",
Aliases: []string{"rm"},
Action: u.Remove,
},
{
Name: "save",
Usage: "Save the network",
Usage: "Save a network",
Aliases: []string{"sa"},
Action: u.Save,
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/api/v5/openvpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (u VPNClient) List(c *cli.Context) error {
func (u VPNClient) Commands() *cli.Command {
return &cli.Command{
Name: "client",
Usage: "Clients by OpenVPN",
Usage: "OpenVPN's client",
Subcommands: []*cli.Command{
{
Name: "list",
Expand Down
2 changes: 1 addition & 1 deletion cmd/api/v5/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (o Output) List(c *cli.Context) error {
func (o Output) Commands() *cli.Command {
return &cli.Command{
Name: "output",
Usage: "Output configuration",
Usage: "Output links",
Subcommands: []*cli.Command{
{
Name: "add",
Expand Down
6 changes: 3 additions & 3 deletions cmd/api/v5/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v5

import (
"fmt"

"github.com/luscis/openlan/cmd/api"
"github.com/luscis/openlan/pkg/libol"
"github.com/luscis/openlan/pkg/schema"
Expand Down Expand Up @@ -53,9 +54,8 @@ func (u PProf) List(c *cli.Context) error {

func (u PProf) Commands(app *api.App) {
app.Command(&cli.Command{
Name: "pprof",
Aliases: []string{"pp"},
Usage: "Configure pprof tool",
Name: "pprof",
Usage: "Debug pprof tool",
Subcommands: []*cli.Command{
{
Name: "list",
Expand Down
2 changes: 1 addition & 1 deletion cmd/api/v5/qos.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Qos struct {
func (q Qos) Commands() *cli.Command {
return &cli.Command{
Name: "qos",
Usage: "QoS for client in network",
Usage: "QoS for client",
Subcommands: []*cli.Command{
QosRule{}.Commands(),
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/api/v5/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (r Route) List(c *cli.Context) error {
func (r Route) Commands() *cli.Command {
return &cli.Command{
Name: "route",
Usage: "Route configuration",
Usage: "Prefix route",
Subcommands: []*cli.Command{
{
Name: "add",
Expand Down
6 changes: 3 additions & 3 deletions cmd/api/v5/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v5

import (
"fmt"

"github.com/luscis/openlan/cmd/api"
"github.com/urfave/cli/v2"
)
Expand All @@ -28,9 +29,8 @@ func (u Server) List(c *cli.Context) error {

func (u Server) Commands(app *api.App) {
app.Command(&cli.Command{
Name: "server",
Aliases: []string{"sr"},
Usage: "Socket server status",
Name: "server",
Usage: "Socket server status",
Subcommands: []*cli.Command{
{
Name: "list",
Expand Down
5 changes: 2 additions & 3 deletions cmd/api/v5/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ func (u User) Check(c *cli.Context) error {
func (u User) Commands(app *api.App) {
lease := time.Now().AddDate(1, 0, 0)
app.Command(&cli.Command{
Name: "user",
Aliases: []string{"us"},
Usage: "User authentication",
Name: "user",
Usage: "Access users",
Subcommands: []*cli.Command{
{
Name: "add",
Expand Down
10 changes: 5 additions & 5 deletions cmd/api/v5/ztrust.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ func (u Guest) List(c *cli.Context) error {
func (u Guest) Commands(user string) *cli.Command {
return &cli.Command{
Name: "guest",
Usage: "zTrust Guest configuration",
Usage: "zTrust Guest",
Subcommands: []*cli.Command{
{
Name: "add",
Usage: "Add a zGuest",
Usage: "Add a guest",
Flags: []cli.Flag{
&cli.StringFlag{Name: "user", Value: user},
&cli.StringFlag{Name: "address"},
Expand All @@ -138,7 +138,7 @@ func (u Guest) Commands(user string) *cli.Command {
},
{
Name: "remove",
Usage: "Remove an existing zGuest",
Usage: "Remove an existing guest",
Aliases: []string{"rm"},
Flags: []cli.Flag{
&cli.StringFlag{Name: "user", Value: user},
Expand All @@ -147,7 +147,7 @@ func (u Guest) Commands(user string) *cli.Command {
},
{
Name: "list",
Usage: "Display all zGuests",
Usage: "Display all guests",
Aliases: []string{"ls"},
Action: u.List,
},
Expand Down Expand Up @@ -225,7 +225,7 @@ func (u Knock) List(c *cli.Context) error {
func (u Knock) Commands(user string) *cli.Command {
return &cli.Command{
Name: "knock",
Usage: "Knock configuration",
Usage: "Knock rules",
Subcommands: []*cli.Command{
{
Name: "add",
Expand Down

0 comments on commit 8377782

Please sign in to comment.