feat(cli): add aliases user->users vault->vaults

This commit is contained in:
Denis Gukov 2024-10-13 14:38:09 +00:00
parent 374b0e9df2
commit 648e31b85d
2 changed files with 11 additions and 7 deletions

View File

@ -1,8 +1,9 @@
package cmd package cmd
import ( import (
"github.com/spf13/cobra"
"os" "os"
"github.com/spf13/cobra"
) )
type userArgs struct { type userArgs struct {
@ -10,7 +11,7 @@ type userArgs struct {
name string name string
email string email string
password string password string
admin bool admin bool
} }
var targetUserArgs userArgs var targetUserArgs userArgs
@ -20,8 +21,9 @@ func init() {
} }
var userCmd = &cobra.Command{ var userCmd = &cobra.Command{
Use: "user", Use: "users",
Short: "Manage users", Aliases: []string{"user"},
Short: "Manage users",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
_ = cmd.Help() _ = cmd.Help()
os.Exit(0) os.Exit(0)

View File

@ -1,8 +1,9 @@
package cmd package cmd
import ( import (
"github.com/spf13/cobra"
"os" "os"
"github.com/spf13/cobra"
) )
type vaultArgs struct { type vaultArgs struct {
@ -16,8 +17,9 @@ func init() {
} }
var vaultCmd = &cobra.Command{ var vaultCmd = &cobra.Command{
Use: "vault", Use: "vaults",
Short: "Manage access keys and other secrets", Aliases: []string{"vault"},
Short: "Manage access keys and other secrets",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
_ = cmd.Help() _ = cmd.Help()
os.Exit(0) os.Exit(0)