Skip to content

Commit

Permalink
docs: Improve CLI documentation for creating cookbooks command (#541)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Rafael de Andrade authored Dec 15, 2021
1 parent a923401 commit 79a1ff4
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion x/pylons/client/cli/tx_cookbook.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cli

import (
"fmt"

sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

"github.com/spf13/cobra"
Expand All @@ -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 [email protected] true --from joe
`,
Args: cobra.ExactArgs(7),
RunE: func(cmd *cobra.Command, args []string) error {
id := args[0]
argsName := args[1]
Expand Down

0 comments on commit 79a1ff4

Please sign in to comment.