Skip to content

Commit

Permalink
chore(cmd/gno): decapitalize command short help and flag usage (#1701)
Browse files Browse the repository at this point in the history
In some places, the first letter of the short help or flag usage is
lowercase, and in some places, it's uppercase. Right now, it is very
random, let's have something uniform across the codebase.

Went with lowercase as Go cmd uses the same.

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [x] Provided any useful hints for running manual tests
- [x] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
  • Loading branch information
harry-hov authored Mar 4, 2024
1 parent 6c5b4cf commit 629c438
Show file tree
Hide file tree
Showing 38 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion contribs/gnodev/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func main() {
commands.Metadata{
Name: "gnodev",
ShortUsage: "gnodev [flags] [path ...]",
ShortHelp: "Runs an in-memory node and gno.land web server for development purposes.",
ShortHelp: "runs an in-memory node and gno.land web server for development purposes.",
LongHelp: `The gnodev command starts an in-memory node and a gno.land web interface
primarily for realm package development. It automatically loads the 'examples' directory and any
additional specified paths.`,
Expand Down
2 changes: 1 addition & 1 deletion contribs/gnokeykc/kc.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func newKcCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "kc",
ShortUsage: "kc <command>",
ShortHelp: "Manage OS keychain",
ShortHelp: "manage OS keychain",
},
commands.NewEmptyConfig(),
commands.HelpExec,
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/genesis/balances.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func newBalancesCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "balances",
ShortUsage: "balances <subcommand> [flags]",
ShortHelp: "manages genesis.json account balances",
LongHelp: "Manipulates the initial genesis.json account balances (pre-mines)",
ShortHelp: "Manages genesis.json account balances",
},
cfg,
commands.HelpExec,
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/genesis/balances_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func newBalancesExportCmd(balancesCfg *balancesCfg, io commands.IO) *commands.Co
commands.Metadata{
Name: "export",
ShortUsage: "balances export [flags] <output-path>",
ShortHelp: "Exports the balances from the genesis.json",
ShortHelp: "exports the balances from the genesis.json",
LongHelp: "Exports the balances from the genesis.json to an output file",
},
commands.NewEmptyConfig(),
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/genesis/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func newGenerateCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "generate",
ShortUsage: "generate [flags]",
ShortHelp: "generates a fresh genesis.json",
LongHelp: "Generates a node's genesis.json based on specified parameters",
ShortHelp: "Generates a fresh genesis.json",
},
cfg,
func(_ context.Context, _ []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/genesis/txs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func newTxsCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "txs",
ShortUsage: "txs <subcommand> [flags]",
ShortHelp: "Manages the initial genesis transactions",
ShortHelp: "manages the initial genesis transactions",
LongHelp: "Manages genesis transactions through input files",
},
cfg,
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/genesis/txs_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func newTxsAddCmd(txsCfg *txsCfg, io commands.IO) *commands.Command {
commands.Metadata{
Name: "add",
ShortUsage: "txs add <tx-file ...>",
ShortHelp: "Imports transactions into the genesis.json",
ShortHelp: "imports transactions into the genesis.json",
LongHelp: "Imports the transactions from a tx-archive backup to the genesis.json",
},
commands.NewEmptyConfig(),
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/genesis/txs_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func newTxsExportCmd(txsCfg *txsCfg, io commands.IO) *commands.Command {
commands.Metadata{
Name: "export",
ShortUsage: "txs export [flags] <output-path>",
ShortHelp: "Exports the transactions from the genesis.json",
ShortHelp: "exports the transactions from the genesis.json",
LongHelp: "Exports the transactions from the genesis.json to an output file",
},
commands.NewEmptyConfig(),
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/genesis/txs_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func newTxsRemoveCmd(txsCfg *txsCfg, io commands.IO) *commands.Command {
commands.Metadata{
Name: "remove",
ShortUsage: "txs remove <tx-hash ...>",
ShortHelp: "Removes the transactions from the genesis.json",
ShortHelp: "removes the transactions from the genesis.json",
LongHelp: "Removes the transactions using the transaction hash",
},
commands.NewEmptyConfig(),
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/genesis/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func newValidatorCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "validator",
ShortUsage: "validator <subcommand> [flags]",
ShortHelp: "validator set management in genesis.json",
LongHelp: "Manipulates the genesis.json validator set",
ShortHelp: "Validator set management in genesis.json",
},
cfg,
commands.HelpExec,
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/genesis/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func newVerifyCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "verify",
ShortUsage: "verify [flags]",
ShortHelp: "verifies a genesis.json",
LongHelp: "Verifies a node's genesis.json",
ShortHelp: "Verifies a genesis.json",
},
cfg,
func(_ context.Context, _ []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/gnoland/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func newRootCmd(io commands.IO) *commands.Command {
cmd := commands.NewCommand(
commands.Metadata{
ShortUsage: "<subcommand> [flags] [<arg>...]",
ShortHelp: "Starts the gnoland blockchain node",
ShortHelp: "starts the gnoland blockchain node",
Options: []ff.Option{
ff.WithConfigFileFlag("config"),
ff.WithConfigFileParser(fftoml.Parser),
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/gnoland/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func newStartCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "start",
ShortUsage: "start [flags]",
ShortHelp: "Run the full node",
ShortHelp: "run the full node",
},
cfg,
func(_ context.Context, _ []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/keyscli/addpkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewMakeAddPkgCmd(rootCfg *client.MakeTxCfg, io commands.IO) *commands.Comma
commands.Metadata{
Name: "addpkg",
ShortUsage: "addpkg [flags] <key-name>",
ShortHelp: "Uploads a new package",
ShortHelp: "uploads a new package",
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/keyscli/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewMakeCallCmd(rootCfg *client.MakeTxCfg, io commands.IO) *commands.Command
commands.Metadata{
Name: "call",
ShortUsage: "call [flags] <key-name or address>",
ShortHelp: "Executes a Realm function call",
ShortHelp: "executes a realm function call",
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/keyscli/maketx.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewMakeTxCmd(rootCfg *client.BaseCfg, io commands.IO) *commands.Command {
commands.Metadata{
Name: "maketx",
ShortUsage: "<subcommand> [flags] [<arg>...]",
ShortHelp: "Composes a tx document to sign",
ShortHelp: "composes a tx document to sign",
},
cfg,
commands.HelpExec,
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/keyscli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewMakeRunCmd(rootCfg *client.MakeTxCfg, cmdio commands.IO) *commands.Comma
commands.Metadata{
Name: "run",
ShortUsage: "run [flags] <key-name or address> <file or - or dir>",
ShortHelp: "Runs Gno code by invoking main() in a package",
ShortHelp: "runs Gno code by invoking main() in a package",
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func newCleanCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "clean",
ShortUsage: "clean [flags]",
ShortHelp: "Removes generated files and cached data",
ShortHelp: "removes generated files and cached data",
},
cfg,
func(ctx context.Context, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (c *envCfg) RegisterFlags(fs *flag.FlagSet) {
&c.json,
"json",
false,
"Prints the environment in JSON format instead of as a shell script.",
"prints the environment in JSON format instead of as a shell script.",
)
}

Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func newLintCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "lint",
ShortUsage: "lint [flags] <package> [<package>...]",
ShortHelp: "Runs the linter for the specified packages",
ShortHelp: "runs the linter for the specified packages",
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
8 changes: 4 additions & 4 deletions gnovm/cmd/gno/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func newModCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "mod",
ShortUsage: "mod <command>",
ShortHelp: "Manage gno.mod",
ShortHelp: "manage gno.mod",
},
commands.NewEmptyConfig(),
commands.HelpExec,
Expand All @@ -49,7 +49,7 @@ func newModDownloadCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "download",
ShortUsage: "download [flags]",
ShortHelp: "Download modules to local cache",
ShortHelp: "download modules to local cache",
},
cfg,
func(_ context.Context, args []string) error {
Expand All @@ -63,7 +63,7 @@ func newModInitCmd() *commands.Command {
commands.Metadata{
Name: "init",
ShortUsage: "init [module-path]",
ShortHelp: "Initialize gno.mod file in current directory",
ShortHelp: "initialize gno.mod file in current directory",
},
commands.NewEmptyConfig(),
func(_ context.Context, args []string) error {
Expand All @@ -77,7 +77,7 @@ func newModTidy(io commands.IO) *commands.Command {
commands.Metadata{
Name: "tidy",
ShortUsage: "tidy",
ShortHelp: "Add missing and remove unused modules",
ShortHelp: "add missing and remove unused modules",
},
commands.NewEmptyConfig(),
func(_ context.Context, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func newReplCmd() *commands.Command {
commands.Metadata{
Name: "repl",
ShortUsage: "repl [flags]",
ShortHelp: "Starts a GnoVM REPL",
ShortHelp: "starts a GnoVM REPL",
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func newRunCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "run",
ShortUsage: "run [flags] <file> [<file>...]",
ShortHelp: "Runs the specified gno files",
ShortHelp: "runs the specified gno files",
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func newTestCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "test",
ShortUsage: "test [flags] <package> [<package>...]",
ShortHelp: "Runs the tests for the specified packages",
ShortHelp: "runs the tests for the specified packages",
LongHelp: `Runs the tests for the specified packages.
'gno test' recompiles each package along with any files with names matching the
Expand Down
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/transpile.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func newTranspileCmd(io commands.IO) *commands.Command {
commands.Metadata{
Name: "transpile",
ShortUsage: "transpile [flags] <package> [<package>...]",
ShortHelp: "Transpiles .gno files to .go",
ShortHelp: "transpiles .gno files to .go",
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
6 changes: 3 additions & 3 deletions tm2/pkg/commands/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func TestHelpUsage(t *testing.T) {
command: &Command{
name: "TestHelpUsage",
shortUsage: "TestHelpUsage [flags] <args>",
shortHelp: "Some short help",
shortHelp: "some short help",
longHelp: "Some long help.",
},
expectedOutput: strings.TrimSpace(`
Expand All @@ -456,13 +456,13 @@ FLAGS
command: &Command{
name: "TestHelpUsage",
shortUsage: "TestHelpUsage [flags] <args>",
shortHelp: "Some short help",
shortHelp: "some short help",
},
expectedOutput: strings.TrimSpace(`
USAGE
TestHelpUsage [flags] <args>
Some short help.
some short help.
FLAGS
-b=false bool
Expand Down
20 changes: 10 additions & 10 deletions tm2/pkg/crypto/keys/client/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewAddCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command {
commands.Metadata{
Name: "add",
ShortUsage: "add [flags] <key-name>",
ShortHelp: "Adds key to the keybase",
ShortHelp: "adds key to the keybase",
},
cfg,
func(_ context.Context, args []string) error {
Expand All @@ -51,7 +51,7 @@ func (c *AddCfg) RegisterFlags(fs *flag.FlagSet) {
fs.Var(
&c.Multisig,
"multisig",
"Construct and store a multisig public key (implies --pubkey)",
"construct and store a multisig public key (implies --pubkey)",
)

fs.IntVar(
Expand All @@ -65,56 +65,56 @@ func (c *AddCfg) RegisterFlags(fs *flag.FlagSet) {
&c.NoSort,
"nosort",
false,
"Keys passed to --multisig are taken in the order they're supplied",
"keys passed to --multisig are taken in the order they're supplied",
)

fs.StringVar(
&c.PublicKey,
"pubkey",
"",
"Parse a public key in bech32 format and save it to disk",
"parse a public key in bech32 format and save it to disk",
)

fs.BoolVar(
&c.UseLedger,
"ledger",
false,
"Store a local reference to a private key on a Ledger device",
"store a local reference to a private key on a Ledger device",
)

fs.BoolVar(
&c.Recover,
"recover",
false,
"Provide seed phrase to recover existing key instead of creating",
"provide seed phrase to recover existing key instead of creating",
)

fs.BoolVar(
&c.NoBackup,
"nobackup",
false,
"Don't print out seed phrase (if others are watching the terminal)",
"don't print out seed phrase (if others are watching the terminal)",
)

fs.BoolVar(
&c.DryRun,
"dryrun",
false,
"Perform action, but don't add key to local keystore",
"perform action, but don't add key to local keystore",
)

fs.Uint64Var(
&c.Account,
"account",
0,
"Account number for HD derivation",
"account number for HD derivation",
)

fs.Uint64Var(
&c.Index,
"index",
0,
"Address index number for HD derivation",
"address index number for HD derivation",
)
}

Expand Down
2 changes: 1 addition & 1 deletion tm2/pkg/crypto/keys/client/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewBroadcastCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command {
commands.Metadata{
Name: "broadcast",
ShortUsage: "broadcast [flags] <file-name>",
ShortHelp: "Broadcasts a signed document",
ShortHelp: "broadcasts a signed document",
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion tm2/pkg/crypto/keys/client/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewDeleteCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command {
commands.Metadata{
Name: "delete",
ShortUsage: "delete [flags] <key-name>",
ShortHelp: "Deletes a key from the keybase",
ShortHelp: "deletes a key from the keybase",
},
cfg,
func(_ context.Context, args []string) error {
Expand Down
Loading

0 comments on commit 629c438

Please sign in to comment.