feat(cmds): adds common aliases for main commands

This commit is contained in:
Lewis Wynne 2025-11-19 12:41:45 +00:00
parent 885ef5ce4f
commit 28582bc0b2
5 changed files with 25 additions and 20 deletions

View file

@ -34,6 +34,7 @@ import (
var delCmd = &cobra.Command{ var delCmd = &cobra.Command{
Use: "del KEY[@DB]", Use: "del KEY[@DB]",
Short: "Delete a key. Optionally specify a db.", Short: "Delete a key. Optionally specify a db.",
Aliases: []string{"delete", "rm", "remove"},
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
RunE: del, RunE: del,
} }

View file

@ -35,6 +35,7 @@ import (
var delDbCmd = &cobra.Command{ var delDbCmd = &cobra.Command{
Use: "delete-db DB", Use: "delete-db DB",
Short: "Delete a database.", Short: "Delete a database.",
Aliases: []string{"del-db", "rm-db", "remove-db"},
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
RunE: delDb, RunE: delDb,
} }

View file

@ -22,6 +22,7 @@ type dumpEntry struct {
var dumpCmd = &cobra.Command{ var dumpCmd = &cobra.Command{
Use: "dump [DB]", Use: "dump [DB]",
Short: "Dump all key/value pairs as NDJSON", Short: "Dump all key/value pairs as NDJSON",
Aliases: []string{"export"},
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
RunE: dump, RunE: dump,
} }

View file

@ -33,6 +33,7 @@ import (
var listCmd = &cobra.Command{ var listCmd = &cobra.Command{
Use: "list [DB]", Use: "list [DB]",
Short: "List the contents of a db.", Short: "List the contents of a db.",
Aliases: []string{"ls"},
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
RunE: list, RunE: list,
} }

View file

@ -16,6 +16,7 @@ import (
var restoreCmd = &cobra.Command{ var restoreCmd = &cobra.Command{
Use: "restore [DB]", Use: "restore [DB]",
Short: "Restore key/value pairs from an NDJSON dump", Short: "Restore key/value pairs from an NDJSON dump",
Aliases: []string{"import"},
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
RunE: restore, RunE: restore,
} }