From 1ba9ca46e36e07ff7e3666210f0f3d2ed70b041a Mon Sep 17 00:00:00 2001 From: James Mills <1290234+prologic@users.noreply.github.com> Date: Wed, 7 Aug 2019 21:44:33 +1000 Subject: [PATCH] Rename set command to put and cleanup the command's docs --- cmd/bitcask/{set.go => put.go} | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename cmd/bitcask/{set.go => put.go} (73%) diff --git a/cmd/bitcask/set.go b/cmd/bitcask/put.go similarity index 73% rename from cmd/bitcask/set.go rename to cmd/bitcask/put.go index 8a8e81c..f8622e7 100644 --- a/cmd/bitcask/set.go +++ b/cmd/bitcask/put.go @@ -13,11 +13,11 @@ import ( "github.com/prologic/bitcask" ) -var setCmd = &cobra.Command{ - Use: "set []", - Aliases: []string{"add"}, - Short: "Add/Set a new Key/Value pair", - Long: `This adds or sets a new key/value pair. +var putCmd = &cobra.Command{ + Use: "put []", + Aliases: []string{"add", "set", "store"}, + Short: "Adds a new Key/Value pair", + Long: `This adds a new key/value pair or modifies an existing one. If the value is not specified as an argument it is read from standard input.`, Args: cobra.MinimumNArgs(1), @@ -33,15 +33,15 @@ If the value is not specified as an argument it is read from standard input.`, value = os.Stdin } - os.Exit(set(path, key, value)) + os.Exit(put(path, key, value)) }, } func init() { - RootCmd.AddCommand(setCmd) + RootCmd.AddCommand(putCmd) } -func set(path, key string, value io.Reader) int { +func put(path, key string, value io.Reader) int { db, err := bitcask.Open(path) if err != nil { log.WithError(err).Error("error opening database")