From dc117d720c166e46cb795235b0e0bdce9f0388a9 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 31 Oct 2022 11:41:43 -0300 Subject: [PATCH 1/5] chore(cli): apply google CLI Syntax for required and optional args --- cmd/ethermintd/genaccounts.go | 2 +- x/evm/client/cli/query.go | 4 ++-- x/evm/client/cli/tx.go | 2 +- x/evm/spec/09_client.md | 6 +++--- x/feemarket/client/cli/query.go | 4 ++-- x/feemarket/spec/08_client.md | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/ethermintd/genaccounts.go b/cmd/ethermintd/genaccounts.go index ceaf7b938c..e3a0286183 100644 --- a/cmd/ethermintd/genaccounts.go +++ b/cmd/ethermintd/genaccounts.go @@ -32,7 +32,7 @@ const ( // AddGenesisAccountCmd returns add-genesis-account cobra Command. func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { cmd := &cobra.Command{ - Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", + Use: "add-genesis-account ADDRESS_OR_KEY_NAME COIN...", Short: "Add a genesis account to genesis.json", Long: `Add a genesis account to genesis.json. The provided account must specify the account address or key name and a list of initial coins. If a key name is given, diff --git a/x/evm/client/cli/query.go b/x/evm/client/cli/query.go index a6753272dd..a6a99b6bad 100644 --- a/x/evm/client/cli/query.go +++ b/x/evm/client/cli/query.go @@ -31,7 +31,7 @@ func GetQueryCmd() *cobra.Command { // GetStorageCmd queries a key in an accounts storage func GetStorageCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "storage [address] [key]", + Use: "storage ADDRESS KEY", Short: "Gets storage for an account with a given key and height", Long: "Gets storage for an account with a given key and height. If the height is not provided, it will use the latest height from context.", //nolint:lll Args: cobra.ExactArgs(2), @@ -71,7 +71,7 @@ func GetStorageCmd() *cobra.Command { // GetCodeCmd queries the code field of a given address func GetCodeCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "code [address]", + Use: "code ADDRESS", Short: "Gets code from an account", Long: "Gets code from an account. If the height is not provided, it will use the latest height from context.", Args: cobra.ExactArgs(1), diff --git a/x/evm/client/cli/tx.go b/x/evm/client/cli/tx.go index 13e9051b91..3ba174b2e1 100644 --- a/x/evm/client/cli/tx.go +++ b/x/evm/client/cli/tx.go @@ -32,7 +32,7 @@ func GetTxCmd() *cobra.Command { // NewRawTxCmd command build cosmos transaction from raw ethereum transaction func NewRawTxCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "raw [tx-hex]", + Use: "raw TX_HEX", Short: "Build cosmos transaction from raw ethereum transaction", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/x/evm/spec/09_client.md b/x/evm/spec/09_client.md index c589f5812f..369e19be4f 100644 --- a/x/evm/spec/09_client.md +++ b/x/evm/spec/09_client.md @@ -19,7 +19,7 @@ The `query` commands allow users to query `evm` state. Allows users to query the smart contract code at a given address. ```go -ethermintd query evm code [address] [flags] +ethermintd query evm code ADDRESS [flags] ``` ```bash @@ -35,7 +35,7 @@ code: "0xef616c92f3cfc9e92dc270d6acff9cea213cecc7020a76ee4395af09bdceb4837a1ebdb Allows users to query storage for an account with a given key and height. ```bash -ethermintd query evm storage [address] [key] [flags] +ethermintd query evm storage ADDRESS KEY [flags] ``` ```bash @@ -55,7 +55,7 @@ The `tx` commands allow users to interact with the `evm` module. Allows users to build cosmos transactions from raw ethereum transaction. ```bash -ethermintd tx evm raw [tx-hex] [flags] +ethermintd tx evm raw TX_HEX [flags] ``` ```bash diff --git a/x/feemarket/client/cli/query.go b/x/feemarket/client/cli/query.go index 2e8e866152..a189eabe2a 100644 --- a/x/feemarket/client/cli/query.go +++ b/x/feemarket/client/cli/query.go @@ -30,7 +30,7 @@ func GetQueryCmd() *cobra.Command { // GetBlockGasCmd queries the gas used in a block func GetBlockGasCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "block-gas", + Use: "block-gas [BLOCK_HEIGHT]", Short: "Get the block gas used at a given block height", Long: `Get the block gas used at a given block height. If the height is not provided, it will use the latest height from context`, @@ -88,7 +88,7 @@ func GetParamsCmd() *cobra.Command { // GetBaseFeeCmd queries the base fee at a given height func GetBaseFeeCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "base-fee", + Use: "base-fee [BLOCK_HEIGHT]", Short: "Get the base fee amount at a given block height", Long: `Get the base fee amount at a given block height. If the height is not provided, it will use the latest height from context.`, diff --git a/x/feemarket/spec/08_client.md b/x/feemarket/spec/08_client.md index 3c8c9d2575..2782d84dbd 100644 --- a/x/feemarket/spec/08_client.md +++ b/x/feemarket/spec/08_client.md @@ -20,7 +20,7 @@ ethermintd query feemarket --help The `base-fee` command allows users to query the block base fee by height. ``` -ethermintd query feemarket base-fee [height] [flags] +ethermintd query feemarket base-fee [BLOCK_HEIGHT] [flags] ``` Example: @@ -40,7 +40,7 @@ base_fee: "512908936" The `block-gas` command allows users to query the block gas by height. ``` -ethermintd query feemarket block-gas [height] [flags] +ethermintd query feemarket block-gas [BLOCK_HEIGHT] [flags] ``` Example: From 50eb330d7f8537a17793e823ca41e260572e4c09 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 31 Oct 2022 11:58:06 -0300 Subject: [PATCH 2/5] chore(cli): add changes in CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7ec000b2e..5077070cfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#1378](https://github.com/evmos/ethermint/pull/1378) Add support for EVM RPC metrics * (ante) [#1390](https://github.com/evmos/ethermint/pull/1390) Added multisig tx support. * (test) [#1396](https://github.com/evmos/ethermint/pull/1396) Increase test coverage for the EVM module `keeper` +* (cmd) [\#1417](https://github.com/evmos/evmos/pull/1417) Apply Google CLI Syntax for required and optional args. ### Bug Fixes From 81814edb85a4499e03548e6dd22a350bbb723fda Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 31 Oct 2022 11:59:04 -0300 Subject: [PATCH 3/5] chore(cli): fix link to PR in CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5077070cfe..6df672ca2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,7 +65,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#1378](https://github.com/evmos/ethermint/pull/1378) Add support for EVM RPC metrics * (ante) [#1390](https://github.com/evmos/ethermint/pull/1390) Added multisig tx support. * (test) [#1396](https://github.com/evmos/ethermint/pull/1396) Increase test coverage for the EVM module `keeper` -* (cmd) [\#1417](https://github.com/evmos/evmos/pull/1417) Apply Google CLI Syntax for required and optional args. +* (cmd) [\#1417](https://github.com/evmos/ethermint/pull/1417) Apply Google CLI Syntax for required and optional args. ### Bug Fixes From 6298c7c74391a3c78eb7faa4acabb27d04446a31 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 31 Oct 2022 13:20:03 -0300 Subject: [PATCH 4/5] chore(cli): fix args in feemarket --- x/feemarket/client/cli/query.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/feemarket/client/cli/query.go b/x/feemarket/client/cli/query.go index a189eabe2a..2e8e866152 100644 --- a/x/feemarket/client/cli/query.go +++ b/x/feemarket/client/cli/query.go @@ -30,7 +30,7 @@ func GetQueryCmd() *cobra.Command { // GetBlockGasCmd queries the gas used in a block func GetBlockGasCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "block-gas [BLOCK_HEIGHT]", + Use: "block-gas", Short: "Get the block gas used at a given block height", Long: `Get the block gas used at a given block height. If the height is not provided, it will use the latest height from context`, @@ -88,7 +88,7 @@ func GetParamsCmd() *cobra.Command { // GetBaseFeeCmd queries the base fee at a given height func GetBaseFeeCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "base-fee [BLOCK_HEIGHT]", + Use: "base-fee", Short: "Get the base fee amount at a given block height", Long: `Get the base fee amount at a given block height. If the height is not provided, it will use the latest height from context.`, From 562f58e1f282c1565f1e950fd6855bfce5fe9122 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 31 Oct 2022 14:24:15 -0300 Subject: [PATCH 5/5] chore(cli): update docs based on comments --- x/feemarket/spec/08_client.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/feemarket/spec/08_client.md b/x/feemarket/spec/08_client.md index 2782d84dbd..8dfe73b313 100644 --- a/x/feemarket/spec/08_client.md +++ b/x/feemarket/spec/08_client.md @@ -20,13 +20,13 @@ ethermintd query feemarket --help The `base-fee` command allows users to query the block base fee by height. ``` -ethermintd query feemarket base-fee [BLOCK_HEIGHT] [flags] +ethermintd query feemarket base-fee [flags] ``` Example: ``` -ethermintd query feemarket base-fee 5... +ethermintd query feemarket base-fee ... ``` Example Output: @@ -40,13 +40,13 @@ base_fee: "512908936" The `block-gas` command allows users to query the block gas by height. ``` -ethermintd query feemarket block-gas [BLOCK_HEIGHT] [flags] +ethermintd query feemarket block-gas [flags] ``` Example: ``` -ethermintd query feemarket block-gas 5... +ethermintd query feemarket block-gas ... ``` Example Output: