Skip to content

Commit 976e556

Browse files
authored
chore: style cmd usage strings (#714)
* fix: sentence-style usage strings * docs: make gen-doc * chore: style cmd short usage strings * fix: long usage strings * docs: make gen-doc
1 parent 3c3bdc4 commit 976e556

File tree

84 files changed

+240
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+240
-234
lines changed

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,9 @@ The tool supports configuration via:
146146
f.StringVar(&myVar, "name", "", "description")
147147
f.IntVar(&count, "count", 0, "description")
148148
```
149+
150+
### Cobra Commands
151+
- Command `Short` descriptions: sentence case with ending period, e.g., `"Generate a node list to seed a node."`
152+
- Command `Long` descriptions: consider using embedded usage.md file via `//go:embed usage.md` pattern; when using inline strings, use sentence case with ending period for complete sentences
153+
- Command `Short` should be brief (~50 characters or less), appears in help menus and command lists
154+
- Command `Long` provides detailed explanation, can be empty if `Short` is sufficient

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@ Note: Do not modify this section! It is auto-generated by `cobra` using `make ge
4141

4242
- [polycli abi](doc/polycli_abi.md) - Provides encoding and decoding functionalities with contract signatures and ABI.
4343

44-
- [polycli cdk](doc/polycli_cdk.md) - Utilities for interacting with CDK networks
44+
- [polycli cdk](doc/polycli_cdk.md) - Utilities for interacting with CDK networks.
4545

46-
- [polycli contract](doc/polycli_contract.md) - Interact with smart contracts and fetch contract information from the blockchain
46+
- [polycli contract](doc/polycli_contract.md) - Interact with smart contracts and fetch contract information from the blockchain.
4747

48-
- [polycli dbbench](doc/polycli_dbbench.md) - Perform a level/pebble db benchmark
48+
- [polycli dbbench](doc/polycli_dbbench.md) - Perform a level/pebble db benchmark.
4949

50-
- [polycli dockerlogger](doc/polycli_dockerlogger.md) - Monitor and filter Docker container logs
50+
- [polycli dockerlogger](doc/polycli_dockerlogger.md) - Monitor and filter Docker container logs.
5151

5252
- [polycli dumpblocks](doc/polycli_dumpblocks.md) - Export a range of blocks from a JSON-RPC endpoint.
5353

54-
- [polycli ecrecover](doc/polycli_ecrecover.md) - Recovers and returns the public key of the signature
54+
- [polycli ecrecover](doc/polycli_ecrecover.md) - Recovers and returns the public key of the signature.
5555

56-
- [polycli enr](doc/polycli_enr.md) - Convert between ENR and Enode format
56+
- [polycli enr](doc/polycli_enr.md) - Convert between ENR and Enode format.
5757

58-
- [polycli fix-nonce-gap](doc/polycli_fix-nonce-gap.md) - Send txs to fix the nonce gap for a specific account
58+
- [polycli fix-nonce-gap](doc/polycli_fix-nonce-gap.md) - Send txs to fix the nonce gap for a specific account.
5959

60-
- [polycli fold-trace](doc/polycli_fold-trace.md) - Trace an execution trace and fold it for visualization
60+
- [polycli fold-trace](doc/polycli_fold-trace.md) - Trace an execution trace and fold it for visualization.
6161

6262
- [polycli fork](doc/polycli_fork.md) - Take a forked block and walk up the chain to do analysis.
6363

@@ -73,27 +73,27 @@ Note: Do not modify this section! It is auto-generated by `cobra` using `make ge
7373

7474
- [polycli monitor](doc/polycli_monitor.md) - Monitor blocks using a JSON-RPC endpoint.
7575

76-
- [polycli monitorv2](doc/polycli_monitorv2.md) - Monitor v2 command stub
76+
- [polycli monitorv2](doc/polycli_monitorv2.md) - Monitor v2 command stub.
7777

7878
- [polycli nodekey](doc/polycli_nodekey.md) - Generate node keys for different blockchain clients and protocols.
7979

8080
- [polycli p2p](doc/polycli_p2p.md) - Set of commands related to devp2p.
8181

82-
- [polycli parse-batch-l2-data](doc/polycli_parse-batch-l2-data.md) - Convert batch l2 data into an ndjson stream
82+
- [polycli parse-batch-l2-data](doc/polycli_parse-batch-l2-data.md) - Convert batch l2 data into an ndjson stream.
8383

8484
- [polycli parseethwallet](doc/polycli_parseethwallet.md) - Extract the private key from an eth wallet.
8585

86-
- [polycli publish](doc/polycli_publish.md) - Publish transactions to the network with high-throughput
86+
- [polycli publish](doc/polycli_publish.md) - Publish transactions to the network with high-throughput.
8787

88-
- [polycli retest](doc/polycli_retest.md) - Convert the standard ETH test fillers into something to be replayed against an RPC
88+
- [polycli retest](doc/polycli_retest.md) - Convert the standard ETH test fillers into something to be replayed against an RPC.
8989

9090
- [polycli rpcfuzz](doc/polycli_rpcfuzz.md) - Continually run a variety of RPC calls and fuzzers.
9191

92-
- [polycli signer](doc/polycli_signer.md) - Utilities for security signing transactions
92+
- [polycli signer](doc/polycli_signer.md) - Utilities for security signing transactions.
9393

94-
- [polycli ulxly](doc/polycli_ulxly.md) - Utilities for interacting with the uLxLy bridge
94+
- [polycli ulxly](doc/polycli_ulxly.md) - Utilities for interacting with the uLxLy bridge.
9595

96-
- [polycli version](doc/polycli_version.md) - Get the current version of this application
96+
- [polycli version](doc/polycli_version.md) - Get the current version of this application.
9797

9898
- [polycli wallet](doc/polycli_wallet.md) - Create or inspect BIP39(ish) wallets.
9999

cmd/abi/encode/encode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var (
1717

1818
var ABIEncodeCmd = &cobra.Command{
1919
Use: "encode [function signature] [args...]",
20-
Short: "ABI encodes a function signature and the inputs",
20+
Short: "ABI encodes a function signature and the inputs.",
2121
Long: "[function-signature] is required and is a fragment in the form <function name>(<types...>). If the function signature has parameters, then those values would have to be passed as arguments after the function signature.",
2222
Args: cobra.MinimumNArgs(1),
2323
PreRunE: func(cmd *cobra.Command, args []string) error {

cmd/cdk/bridge.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import (
1313

1414
var bridgeCmd = &cobra.Command{
1515
Use: "bridge",
16-
Short: "Utilities for interacting with CDK bridge contract",
16+
Short: "Utilities for interacting with CDK bridge contract.",
1717
Args: cobra.NoArgs,
1818
}
1919

2020
//go:embed bridgeInspectUsage.md
2121
var bridgeInspectUsage string
2222
var bridgeInspectCmd = &cobra.Command{
2323
Use: "inspect",
24-
Short: "List some basic information about the bridge",
24+
Short: "List some basic information about the bridge.",
2525
Long: bridgeInspectUsage,
2626
Args: cobra.NoArgs,
2727
RunE: func(cmd *cobra.Command, args []string) error {
@@ -33,7 +33,7 @@ var bridgeInspectCmd = &cobra.Command{
3333
var bridgeDumpUsage string
3434
var bridgeDumpCmd = &cobra.Command{
3535
Use: "dump",
36-
Short: "List detailed information about the bridge",
36+
Short: "List detailed information about the bridge.",
3737
Long: bridgeDumpUsage,
3838
Args: cobra.NoArgs,
3939
RunE: func(cmd *cobra.Command, args []string) error {
@@ -45,7 +45,7 @@ var bridgeDumpCmd = &cobra.Command{
4545
var bridgeMonitorUsage string
4646
var bridgeMonitorCmd = &cobra.Command{
4747
Use: "monitor",
48-
Short: "Watch for bridge events and display them on the fly",
48+
Short: "Watch for bridge events and display them on the fly.",
4949
Long: bridgeMonitorUsage,
5050
Args: cobra.NoArgs,
5151
RunE: func(cmd *cobra.Command, args []string) error {

cmd/cdk/cdk.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ var (
104104

105105
var CDKCmd = &cobra.Command{
106106
Use: "cdk",
107-
Short: "Utilities for interacting with CDK networks",
108-
Long: "Basic utility commands for interacting with the cdk contracts",
107+
Short: "Utilities for interacting with CDK networks.",
108+
Long: "Basic utility commands for interacting with the cdk contracts.",
109109
PersistentPreRun: func(cmd *cobra.Command, args []string) {
110110
rpcURL := flag_loader.GetRpcUrlFlagValue(cmd)
111111
if rpcURL != nil {

cmd/cdk/ger.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import (
1313

1414
var gerCmd = &cobra.Command{
1515
Use: "ger",
16-
Short: "Utilities for interacting with CDK global exit root manager contract",
16+
Short: "Utilities for interacting with CDK global exit root manager contract.",
1717
Args: cobra.NoArgs,
1818
}
1919

2020
//go:embed gerInspectUsage.md
2121
var gerInspectUsage string
2222
var gerInspectCmd = &cobra.Command{
2323
Use: "inspect",
24-
Short: "List some basic information about the global exit root manager",
24+
Short: "List some basic information about the global exit root manager.",
2525
Long: gerInspectUsage,
2626
Args: cobra.NoArgs,
2727
RunE: func(cmd *cobra.Command, args []string) error {
@@ -33,7 +33,7 @@ var gerInspectCmd = &cobra.Command{
3333
var gerDumpUsage string
3434
var gerDumpCmd = &cobra.Command{
3535
Use: "dump",
36-
Short: "List detailed information about the global exit root manager",
36+
Short: "List detailed information about the global exit root manager.",
3737
Long: gerDumpUsage,
3838
Args: cobra.NoArgs,
3939
RunE: func(cmd *cobra.Command, args []string) error {
@@ -45,7 +45,7 @@ var gerDumpCmd = &cobra.Command{
4545
var gerMonitorUsage string
4646
var gerMonitorCmd = &cobra.Command{
4747
Use: "monitor",
48-
Short: "Watch for global exit root manager events and display them on the fly",
48+
Short: "Watch for global exit root manager events and display them on the fly.",
4949
Long: gerMonitorUsage,
5050
Args: cobra.NoArgs,
5151
RunE: func(cmd *cobra.Command, args []string) error {

cmd/cdk/rollup.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
var rollupCmd = &cobra.Command{
2020
Use: "rollup",
21-
Short: "Utilities for interacting with CDK rollup manager to get rollup specific information",
21+
Short: "Utilities for interacting with CDK rollup manager to get rollup specific information.",
2222
Args: cobra.NoArgs,
2323
}
2424

@@ -27,7 +27,7 @@ var rollupInspectUsage string
2727

2828
var rollupInspectCmd = &cobra.Command{
2929
Use: "inspect",
30-
Short: "List some basic information about a specific rollup",
30+
Short: "List some basic information about a specific rollup.",
3131
Long: rollupInspectUsage,
3232
Args: cobra.NoArgs,
3333
RunE: func(cmd *cobra.Command, args []string) error {
@@ -40,7 +40,7 @@ var rollupDumpUsage string
4040

4141
var rollupDumpCmd = &cobra.Command{
4242
Use: "dump",
43-
Short: "List detailed information about a specific rollup",
43+
Short: "List detailed information about a specific rollup.",
4444
Long: rollupDumpUsage,
4545
Args: cobra.NoArgs,
4646
RunE: func(cmd *cobra.Command, args []string) error {
@@ -53,7 +53,7 @@ var rollupMonitorUsage string
5353

5454
var rollupMonitorCmd = &cobra.Command{
5555
Use: "monitor",
56-
Short: "Watch for rollup events and display them on the fly",
56+
Short: "Watch for rollup events and display them on the fly.",
5757
Long: rollupMonitorUsage,
5858
Args: cobra.NoArgs,
5959
RunE: func(cmd *cobra.Command, args []string) error {

cmd/cdk/rollup_manager.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
var rollupManagerCmd = &cobra.Command{
1616
Use: "rollup-manager",
17-
Short: "Utilities for interacting with CDK rollup manager contract",
17+
Short: "Utilities for interacting with CDK rollup manager contract.",
1818
Args: cobra.NoArgs,
1919
}
2020

@@ -23,7 +23,7 @@ var rollupManagerListRollupsUsage string
2323

2424
var rollupManagerListRollupsCmd = &cobra.Command{
2525
Use: "list-rollups",
26-
Short: "List some basic information about each rollup",
26+
Short: "List some basic information about each rollup.",
2727
Long: rollupManagerListRollupsUsage,
2828
Args: cobra.NoArgs,
2929
RunE: func(cmd *cobra.Command, args []string) error {
@@ -36,7 +36,7 @@ var rollupManagerListRollupTypesUsage string
3636

3737
var rollupManagerListRollupTypesCmd = &cobra.Command{
3838
Use: "list-rollup-types",
39-
Short: "List some basic information about each rollup type",
39+
Short: "List some basic information about each rollup type.",
4040
Long: rollupManagerListRollupTypesUsage,
4141
Args: cobra.NoArgs,
4242
RunE: func(cmd *cobra.Command, args []string) error {
@@ -49,7 +49,7 @@ var rollupManagerInspectUsage string
4949

5050
var rollupManagerInspectCmd = &cobra.Command{
5151
Use: "inspect",
52-
Short: "List some basic information about the rollup manager",
52+
Short: "List some basic information about the rollup manager.",
5353
Long: rollupManagerInspectUsage,
5454
Args: cobra.NoArgs,
5555
RunE: func(cmd *cobra.Command, args []string) error {
@@ -62,7 +62,7 @@ var rollupManagerDumpUsage string
6262

6363
var rollupManagerDumpCmd = &cobra.Command{
6464
Use: "dump",
65-
Short: "List detailed information about the rollup manager",
65+
Short: "List detailed information about the rollup manager.",
6666
Long: rollupManagerDumpUsage,
6767
Args: cobra.NoArgs,
6868
RunE: func(cmd *cobra.Command, args []string) error {
@@ -75,7 +75,7 @@ var rollupManagerMonitorUsage string
7575

7676
var rollupManagerMonitorCmd = &cobra.Command{
7777
Use: "monitor",
78-
Short: "Watch for rollup manager events and display them on the fly",
78+
Short: "Watch for rollup manager events and display them on the fly.",
7979
Long: rollupManagerMonitorUsage,
8080
Args: cobra.NoArgs,
8181
RunE: func(cmd *cobra.Command, args []string) error {

cmd/contract/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type ContractInfo struct {
4343

4444
var Cmd = &cobra.Command{
4545
Use: "contract",
46-
Short: "Interact with smart contracts and fetch contract information from the blockchain",
46+
Short: "Interact with smart contracts and fetch contract information from the blockchain.",
4747
Long: usage,
4848
PersistentPreRun: func(cmd *cobra.Command, args []string) {
4949
rpcURL := flag_loader.GetRpcUrlFlagValue(cmd)

cmd/dbbench/dbbench.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func NewTestResult(startTime, endTime time.Time, desc string, opCount uint64) *T
138138

139139
var DBBenchCmd = &cobra.Command{
140140
Use: "dbbench [flags]",
141-
Short: "Perform a level/pebble db benchmark",
141+
Short: "Perform a level/pebble db benchmark.",
142142
Long: usage,
143143
RunE: func(cmd *cobra.Command, args []string) error {
144144
log.Info().Msg("Starting db test")

0 commit comments

Comments
 (0)