feat(cmds): 's' and 'g' aliases for set and get

This commit is contained in:
Lewis Wynne 2025-11-19 12:44:04 +00:00
parent 28582bc0b2
commit 323c4d915a
2 changed files with 10 additions and 8 deletions

View file

@ -30,10 +30,11 @@ import (
// getCmd represents the get command // getCmd represents the get command
var getCmd = &cobra.Command{ var getCmd = &cobra.Command{
Use: "get KEY[@DB]", Use: "get KEY[@DB]",
Short: "Get a value for a key. Optionally specify a db.", Short: "Get a value for a key. Optionally specify a db.",
Args: cobra.ExactArgs(1), Aliases: []string{"g"},
RunE: get, Args: cobra.ExactArgs(1),
RunE: get,
} }
func get(cmd *cobra.Command, args []string) error { func get(cmd *cobra.Command, args []string) error {

View file

@ -30,10 +30,11 @@ import (
// setCmd represents the set command // setCmd represents the set command
var setCmd = &cobra.Command{ var setCmd = &cobra.Command{
Use: "set KEY[@DB] [VALUE]", Use: "set KEY[@DB] [VALUE]",
Short: "Set a value for a key by passing VALUE or from Stdin. Optionally specify a db.", Short: "Set a value for a key by passing VALUE or from Stdin. Optionally specify a db.",
Args: cobra.RangeArgs(1, 2), Aliases: []string{"s"},
RunE: set, Args: cobra.RangeArgs(1, 2),
RunE: set,
} }
func set(cmd *cobra.Command, args []string) error { func set(cmd *cobra.Command, args []string) error {