From 79a1ff44ed7a7c29ad84cb987f2dc6a835e730ca Mon Sep 17 00:00:00 2001 From: Rafael de Andrade <86610330+andraderaf@users.noreply.github.com> Date: Wed, 15 Dec 2021 15:06:36 -0500 Subject: [PATCH] docs: Improve CLI documentation for creating cookbooks command (#541) * Improve CLI documentation for creating cookbooks command * Adding the email documentation * Change minimum char size * Automate the min field size requirements * Restore go.mod, go.sum --- x/pylons/client/cli/tx_cookbook.go | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/x/pylons/client/cli/tx_cookbook.go b/x/pylons/client/cli/tx_cookbook.go index 2aa12c9e3c..43cc058fbb 100644 --- a/x/pylons/client/cli/tx_cookbook.go +++ b/x/pylons/client/cli/tx_cookbook.go @@ -1,6 +1,8 @@ package cli import ( + "fmt" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/spf13/cobra" @@ -15,10 +17,29 @@ import ( ) func CmdCreateCookbook() *cobra.Command { + + longText := fmt.Sprintf(` +Create a new cookbook using the following arguments : + +* id : a unique identifier to your cookbook. Only letters, numbers and underscore (should not be the first character) allowed +* name: a human readable name for your cookbook, with a minimum of %d characters long +* description : A more detailed description of your cookbook. Minimum %d chars long +* developer : name of the developer +* version : the version of the cookbook in semVer format, ex.: v0.0.0 +* support-email : a valid email +* enabled : whether or not the cookbook is enabled + +Note that the --from flag is mandatory, as indicates the key to be used to sign the transaction. + + `, types.DefaultMinFieldLength, types.DefaultMinFieldLength) cmd := &cobra.Command{ Use: "create-cookbook [id] [name] [description] [developer] [version] [support-email] [enabled]", Short: "create new cookbook", - Args: cobra.ExactArgs(7), + Long: longText, + Example: ` +pylonsd tx pylons create-cookbook "loud123456" "Legend of the Undead Dragon" "Cookbook for running pylons recreation of LOUD" "Pylons Inc" v0.3.1 test@pylons.com true --from joe + `, + Args: cobra.ExactArgs(7), RunE: func(cmd *cobra.Command, args []string) error { id := args[0] argsName := args[1]