From 28582bc0b2745fb0846c4ffbca5d1930c191de9c Mon Sep 17 00:00:00 2001 From: lew Date: Wed, 19 Nov 2025 12:41:45 +0000 Subject: [PATCH] feat(cmds): adds common aliases for main commands --- cmd/del.go | 9 +++++---- cmd/delete-db.go | 9 +++++---- cmd/dump.go | 9 +++++---- cmd/list.go | 9 +++++---- cmd/restore.go | 9 +++++---- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/cmd/del.go b/cmd/del.go index c87c84a..23f1dab 100644 --- a/cmd/del.go +++ b/cmd/del.go @@ -32,10 +32,11 @@ import ( // delCmd represents the set command var delCmd = &cobra.Command{ - Use: "del KEY[@DB]", - Short: "Delete a key. Optionally specify a db.", - Args: cobra.ExactArgs(1), - RunE: del, + Use: "del KEY[@DB]", + Short: "Delete a key. Optionally specify a db.", + Aliases: []string{"delete", "rm", "remove"}, + Args: cobra.ExactArgs(1), + RunE: del, } func del(cmd *cobra.Command, args []string) error { diff --git a/cmd/delete-db.go b/cmd/delete-db.go index 049b874..3120755 100644 --- a/cmd/delete-db.go +++ b/cmd/delete-db.go @@ -33,10 +33,11 @@ import ( // delDbCmd represents the set command var delDbCmd = &cobra.Command{ - Use: "delete-db DB", - Short: "Delete a database.", - Args: cobra.ExactArgs(1), - RunE: delDb, + Use: "delete-db DB", + Short: "Delete a database.", + Aliases: []string{"del-db", "rm-db", "remove-db"}, + Args: cobra.ExactArgs(1), + RunE: delDb, } func delDb(cmd *cobra.Command, args []string) error { diff --git a/cmd/dump.go b/cmd/dump.go index 91f4a6c..1b27cef 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -20,10 +20,11 @@ type dumpEntry struct { } var dumpCmd = &cobra.Command{ - Use: "dump [DB]", - Short: "Dump all key/value pairs as NDJSON", - Args: cobra.MaximumNArgs(1), - RunE: dump, + Use: "dump [DB]", + Short: "Dump all key/value pairs as NDJSON", + Aliases: []string{"export"}, + Args: cobra.MaximumNArgs(1), + RunE: dump, } func dump(cmd *cobra.Command, args []string) error { diff --git a/cmd/list.go b/cmd/list.go index e4c2b48..43c8604 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -31,10 +31,11 @@ import ( ) var listCmd = &cobra.Command{ - Use: "list [DB]", - Short: "List the contents of a db.", - Args: cobra.MaximumNArgs(1), - RunE: list, + Use: "list [DB]", + Short: "List the contents of a db.", + Aliases: []string{"ls"}, + Args: cobra.MaximumNArgs(1), + RunE: list, } func list(cmd *cobra.Command, args []string) error { diff --git a/cmd/restore.go b/cmd/restore.go index 24001ad..d4df0f8 100644 --- a/cmd/restore.go +++ b/cmd/restore.go @@ -14,10 +14,11 @@ import ( ) var restoreCmd = &cobra.Command{ - Use: "restore [DB]", - Short: "Restore key/value pairs from an NDJSON dump", - Args: cobra.MaximumNArgs(1), - RunE: restore, + Use: "restore [DB]", + Short: "Restore key/value pairs from an NDJSON dump", + Aliases: []string{"import"}, + Args: cobra.MaximumNArgs(1), + RunE: restore, } func restore(cmd *cobra.Command, args []string) error {