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
var getCmd = &cobra.Command{
Use: "get KEY[@DB]",
Short: "Get a value for a key. Optionally specify a db.",
Args: cobra.ExactArgs(1),
RunE: get,
Use: "get KEY[@DB]",
Short: "Get a value for a key. Optionally specify a db.",
Aliases: []string{"g"},
Args: cobra.ExactArgs(1),
RunE: get,
}
func get(cmd *cobra.Command, args []string) error {

View file

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