-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
@@ -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] | ||
|