Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: inline help text for the scaffold query command #3348

Closed
wants to merge 4 commits into from

Conversation

AndrewDonelson
Copy link
Contributor

New Output:

➜  dist git:(main) ✗ ./ignite scaffold query --help
Query for fetching data from a blockchain

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

Usage:
  ignite scaffold query [name] [request_field1] [request_field2:field2_type] ... [flags]

Examples:
   ignite scaffold map todo-item priority:int desc:string tags:array.string done:bool

Flags:
      --clear-cache        clear the build cache (advanced)
  -d, --desc string        description of the CLI to broadcast a tx with the message
  -h, --help               help for query
      --module string      module to add the query into. Default: app's main module
      --paginated          define if the request can be paginated
  -p, --path string        path of the app (default ".")
  -r, --response strings   response fields
  -y, --yes                answers interactive yes/no questions with yes

@AndrewDonelson AndrewDonelson changed the title implemented issue #3346 feat: implemented issue #3346 Dec 30, 2022
@fadeev
Copy link
Contributor

fadeev commented Dec 30, 2022

Thanks for looking into this, @AndrewDonelson!

Supported type information is useful in the query --help, however, this way when we change how Ignite works with types we would have to update it in two different places.

I propose instead we just have the table in the output of ignite scaffold type --help and add a note to ignite scaffold list/map/single/message/query that says that type info is available in type --help.

@fadeev
Copy link
Contributor

fadeev commented Dec 30, 2022

Also, the help text is for a query, but the provided example is for a map.

ignite scaffold map todo-item priority:int desc:string tags:array.string done:bool

@fadeev fadeev changed the title feat: implemented issue #3346 docs: implemented issue #3346 Dec 30, 2022
@fadeev fadeev changed the title docs: implemented issue #3346 docs: inline help text for the scaffold query command Dec 30, 2022
@codecov
Copy link

codecov bot commented Dec 30, 2022

Codecov Report

Merging #3348 (e7d0d10) into main (e2cc76c) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

❗ Current head e7d0d10 differs from pull request most recent head c612c3c. Consider uploading reports for the commit c612c3c to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3348      +/-   ##
==========================================
- Coverage   19.90%   19.90%   -0.01%     
==========================================
  Files         384      384              
  Lines       31003    31005       +2     
==========================================
  Hits         6170     6170              
- Misses      24245    24247       +2     
  Partials      588      588              
Impacted Files Coverage Δ
ignite/cmd/scaffold.go 0.00% <ø> (ø)
ignite/cmd/scaffold_query.go 0.00% <0.00%> (ø)

@AndrewDonelson
Copy link
Contributor Author

New Output:

➜  dist git:(main) ✗ ./ignite scaffold query --help
Query for fetching data from a blockchain

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

Usage:
  ignite scaffold query [name] [request_field1] [request_field2:field2_type] ... [flags]

Examples:
   ignite scaffold map todo-item priority:int desc:string tags:array.string done:bool

Flags:
      --clear-cache        clear the build cache (advanced)
  -d, --desc string        description of the CLI to broadcast a tx with the message
  -h, --help               help for query
      --module string      module to add the query into. Default: app's main module
      --paginated          define if the request can be paginated
  -p, --path string        path of the app (default ".")
  -r, --response strings   response fields
  -y, --yes                answers interactive yes/no questions with yes

@AndrewDonelson
Copy link
Contributor Author

Thanks for looking into this, @AndrewDonelson!

Supported type information is useful in the query --help, however, this way when we change how Ignite works with types we would have to update it in two different places.

I propose instead we just have the table in the output of ignite scaffold type --help and add a note to ignite scaffold list/map/single/message/query that says that type info is available in type --help.

Sure. I will make proper changes

add info on referencing table
@AndrewDonelson
Copy link
Contributor Author

Closing. See PR#3349

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants