Skip to content

Commit

Permalink
implemented issue ignite#3346
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDonelson committed Dec 30, 2022
1 parent c4c3faa commit ac60e27
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
22 changes: 22 additions & 0 deletions ignite/cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,28 @@ const (
msgCommitPrompt = "Do you want to proceed without committing your saved changes"

statusScaffolding = "Scaffolding..."

supportFieldTypes = `
Currently supports:
| Type | Alias | Index | Code Type | Description |
|--------------|---------|-------|-----------|---------------------------------|
| string | - | yes | string | Text type |
| array.string | strings | no | []string | List of text type |
| bool | - | yes | bool | Boolean type |
| int | - | yes | int32 | Integer type |
| array.int | ints | no | []int32 | List of integers types |
| uint | - | yes | uint64 | Unsigned integer type |
| array.uint | uints | no | []uint64 | List of unsigned integers types |
| coin | - | no | sdk.Coin | Cosmos SDK coin type |
| array.coin | coins | no | sdk.Coins | List of Cosmos SDK coin types |
Field Usage:
- fieldName
- fieldName:fieldType
If no :fieldType, default (string) is used
`
)

// NewScaffold returns a command that groups scaffolding related sub commands.
Expand Down
6 changes: 4 additions & 2 deletions ignite/cmd/scaffold_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ const (
// NewScaffoldQuery command creates a new type command to scaffold queries.
func NewScaffoldQuery() *cobra.Command {
c := &cobra.Command{
Use: "query [name] [request_field1] [request_field2] ...",
Short: "Query for fetching data from a blockchain",
Use: "query [name] [request_field1] [request_field2:field2_type] ...",
Short: "Query for fetching data from a blockchain\n",
Long: fmt.Sprintf("Query for fetching data from a blockchain\n%s\n", supportFieldTypes),
Example: " ignite scaffold map todo-item priority:int desc:string tags:array.string done:bool",
Args: cobra.MinimumNArgs(1),
PreRunE: gitChangesConfirmPreRunHandler,
RunE: queryHandler,
Expand Down

0 comments on commit ac60e27

Please sign in to comment.