Skip to content

Commit

Permalink
Merge pull request #381 from bart1024/alias
Browse files Browse the repository at this point in the history
Support command shorthands
  • Loading branch information
jzelinskie authored May 30, 2024
2 parents 5aa177d + b11e942 commit e382f15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions internal/cmd/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ func registerContextCmd(rootCmd *cobra.Command) {
}

var contextCmd = &cobra.Command{
Use: "context <subcommand>",
Short: "Manage configurations for connecting to SpiceDB deployments",
Use: "context <subcommand>",
Short: "Manage configurations for connecting to SpiceDB deployments",
Aliases: []string{"ctx"},
}

var contextListCmd = &cobra.Command{
Use: "list",
Short: "Lists all available contexts",
Aliases: []string{"ls"},
Args: cobra.ExactArgs(0),
ValidArgsFunction: cobra.NoFileCompletions,
RunE: contextListCmdFunc,
Expand All @@ -49,6 +51,7 @@ var contextSetCmd = &cobra.Command{
var contextRemoveCmd = &cobra.Command{
Use: "remove <system>",
Short: "Removes a context",
Aliases: []string{"rm"},
Args: cobra.ExactArgs(1),
ValidArgsFunction: ContextGet,
RunE: contextRemoveCmdFunc,
Expand Down
5 changes: 3 additions & 2 deletions internal/commands/permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ func RegisterPermissionCmd(rootCmd *cobra.Command) *cobra.Command {
}

var permissionCmd = &cobra.Command{
Use: "permission <subcommand>",
Short: "Query the permissions in a permissions system",
Use: "permission <subcommand>",
Short: "Query the permissions in a permissions system",
Aliases: []string{"perm"},
}

var checkBulkCmd = &cobra.Command{
Expand Down

0 comments on commit e382f15

Please sign in to comment.