From 2f5c26f14b3b4e02e493673d453d773eb49b7975 Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Wed, 3 Jul 2024 15:35:18 +0300 Subject: [PATCH 1/7] cli: use capital letter for Usage To unified cli help only capital letter is used in Usage field. Signed-off-by: Ekaterina Pavlova --- cli/options/options.go | 18 ++++---- cli/server/server.go | 18 ++++---- cli/smartcontract/generate.go | 4 +- cli/smartcontract/smart_contract.go | 54 ++++++++++++------------ cli/txctx/tx.go | 8 ++-- cli/util/convert.go | 6 +-- cli/vm/vm.go | 2 +- cli/wallet/nep11.go | 20 ++++----- cli/wallet/nep17.go | 12 +++--- cli/wallet/validator.go | 6 +-- cli/wallet/wallet.go | 44 +++++++++---------- scripts/compare-states/compare-states.go | 2 +- 12 files changed, 97 insertions(+), 97 deletions(-) diff --git a/cli/options/options.go b/cli/options/options.go index e9504569e..57856d059 100644 --- a/cli/options/options.go +++ b/cli/options/options.go @@ -49,18 +49,18 @@ const RPCEndpointFlag = "rpc-endpoint" // Wallet is a set of flags used for wallet operations. var Wallet = []cli.Flag{cli.StringFlag{ Name: "wallet, w", - Usage: "wallet to use to get the key for transaction signing; conflicts with --wallet-config flag", + Usage: "Wallet to use to get the key for transaction signing; conflicts with --wallet-config flag", }, cli.StringFlag{ Name: "wallet-config", - Usage: "path to wallet config to use to get the key for transaction signing; conflicts with --wallet flag"}, + Usage: "Path to wallet config to use to get the key for transaction signing; conflicts with --wallet flag"}, } // Network is a set of flags for choosing the network to operate on // (privnet/mainnet/testnet). var Network = []cli.Flag{ - cli.BoolFlag{Name: "privnet, p", Usage: "use private network configuration (if --config-file option is not specified)"}, - cli.BoolFlag{Name: "mainnet, m", Usage: "use mainnet network configuration (if --config-file option is not specified)"}, - cli.BoolFlag{Name: "testnet, t", Usage: "use testnet network configuration (if --config-file option is not specified)"}, + cli.BoolFlag{Name: "privnet, p", Usage: "Use private network configuration (if --config-file option is not specified)"}, + cli.BoolFlag{Name: "mainnet, m", Usage: "Use mainnet network configuration (if --config-file option is not specified)"}, + cli.BoolFlag{Name: "testnet, t", Usage: "Use testnet network configuration (if --config-file option is not specified)"}, cli.BoolFlag{Name: "unittest", Hidden: true}, } @@ -86,27 +86,27 @@ var Historic = cli.StringFlag{ // Config is a flag for commands that use node configuration. var Config = cli.StringFlag{ Name: "config-path", - Usage: "path to directory with per-network configuration files (may be overridden by --config-file option for the configuration file)", + Usage: "Path to directory with per-network configuration files (may be overridden by --config-file option for the configuration file)", } // ConfigFile is a flag for commands that use node configuration and provide // path to the specific config file instead of config path. var ConfigFile = cli.StringFlag{ Name: "config-file", - Usage: "path to the node configuration file (overrides --config-path option)", + Usage: "Path to the node configuration file (overrides --config-path option)", } // RelativePath is a flag for commands that use node configuration and provide // a prefix to all relative paths in config files. var RelativePath = cli.StringFlag{ Name: "relative-path", - Usage: "a prefix to all relative paths in the node configuration file", + Usage: "Prefix to all relative paths in the node configuration file", } // Debug is a flag for commands that allow node in debug mode usage. var Debug = cli.BoolFlag{ Name: "debug, d", - Usage: "enable debug logging (LOTS of output, overrides configuration)", + Usage: "Enable debug logging (LOTS of output, overrides configuration)", } var errNoEndpoint = errors.New("no RPC endpoint specified, use option '--" + RPCEndpointFlag + "' or '-r'") diff --git a/cli/server/server.go b/cli/server/server.go index d51b70159..382e25e13 100644 --- a/cli/server/server.go +++ b/cli/server/server.go @@ -43,7 +43,7 @@ func NewCommands() []cli.Command { cfgWithCountFlags = append(cfgWithCountFlags, cli.UintFlag{ Name: "count, c", - Usage: "number of blocks to be processed (default or 0: all chain)", + Usage: "Number of blocks to be processed (default or 0: all chain)", }, ) var cfgCountOutFlags = make([]cli.Flag, len(cfgWithCountFlags)) @@ -51,7 +51,7 @@ func NewCommands() []cli.Command { cfgCountOutFlags = append(cfgCountOutFlags, cli.UintFlag{ Name: "start, s", - Usage: "block number to start from (default: 0)", + Usage: "Block number to start from (default: 0)", }, cli.StringFlag{ Name: "out, o", @@ -67,11 +67,11 @@ func NewCommands() []cli.Command { }, cli.StringFlag{ Name: "dump", - Usage: "directory for storing JSON dumps", + Usage: "Directory for storing JSON dumps", }, cli.BoolFlag{ Name: "incremental, n", - Usage: "use if dump is incremental", + Usage: "Use if dump is incremental", }, ) var cfgHeightFlags = make([]cli.Flag, len(cfgFlags)+1) @@ -84,32 +84,32 @@ func NewCommands() []cli.Command { return []cli.Command{ { Name: "node", - Usage: "start a NeoGo node", + Usage: "Start a NeoGo node", UsageText: "neo-go node [--config-path path] [-d] [-p/-m/-t] [--config-file file]", Action: startServer, Flags: cfgFlags, }, { Name: "db", - Usage: "database manipulations", + Usage: "Database manipulations", Subcommands: []cli.Command{ { Name: "dump", - Usage: "dump blocks (starting with block #1) to the file", + Usage: "Dump blocks (starting with block #1) to the file", UsageText: "neo-go db dump -o file [-s start] [-c count] [--config-path path] [-p/-m/-t] [--config-file file]", Action: dumpDB, Flags: cfgCountOutFlags, }, { Name: "restore", - Usage: "restore blocks from the file", + Usage: "Restore blocks from the file", UsageText: "neo-go db restore -i file [--dump] [-n] [-c count] [--config-path path] [-p/-m/-t] [--config-file file]", Action: restoreDB, Flags: cfgCountInFlags, }, { Name: "reset", - Usage: "reset database to the previous state", + Usage: "Reset database to the previous state", UsageText: "neo-go db reset --height height [--config-path path] [-p/-m/-t] [--config-file file]", Action: resetDB, Flags: cfgHeightFlags, diff --git a/cli/smartcontract/generate.go b/cli/smartcontract/generate.go index 28f9f18ce..cb8d20722 100644 --- a/cli/smartcontract/generate.go +++ b/cli/smartcontract/generate.go @@ -36,7 +36,7 @@ var generatorFlags = []cli.Flag{ var generateWrapperCmd = cli.Command{ Name: "generate-wrapper", - Usage: "generate wrapper to use in other contracts", + Usage: "Generate wrapper to use in other contracts", UsageText: "neo-go contract generate-wrapper --manifest --out [--hash ] [--config ]", Description: `Generates a Go wrapper to use it in other smart contracts. If the --hash flag is provided, CALLT instruction is used for the target contract @@ -50,7 +50,7 @@ var generateWrapperCmd = cli.Command{ var generateRPCWrapperCmd = cli.Command{ Name: "generate-rpcwrapper", - Usage: "generate RPC wrapper to use for data reads", + Usage: "Generate RPC wrapper to use for data reads", UsageText: "neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]", Action: contractGenerateRPCWrapper, Flags: generatorFlags, diff --git a/cli/smartcontract/smart_contract.go b/cli/smartcontract/smart_contract.go index 87b04ed95..442fcf4e3 100644 --- a/cli/smartcontract/smart_contract.go +++ b/cli/smartcontract/smart_contract.go @@ -45,7 +45,7 @@ var ( errFileExist = errors.New("A file with given smart-contract name already exists") addressFlag = flags.AddressFlag{ Name: addressFlagName, - Usage: "address to use as transaction signee (and gas source)", + Usage: "Address to use as transaction signee (and gas source)", } ) @@ -108,28 +108,28 @@ func NewCommands() []cli.Command { manifestAddGroupFlags := append([]cli.Flag{ cli.StringFlag{ Name: "sender, s", - Usage: "deploy transaction sender", + Usage: "Deploy transaction sender", }, flags.AddressFlag{ Name: addressFlagName, // use the same name for handler code unification. - Usage: "account to sign group with", + Usage: "Account to sign group with", }, cli.StringFlag{ Name: "nef, n", - Usage: "path to the NEF file", + Usage: "Path to the NEF file", }, cli.StringFlag{ Name: "manifest, m", - Usage: "path to the manifest", + Usage: "Path to the manifest", }, }, options.Wallet...) return []cli.Command{{ Name: "contract", - Usage: "compile - debug - deploy smart contracts", + Usage: "Compile - debug - deploy smart contracts", Subcommands: []cli.Command{ { Name: "compile", - Usage: "compile a smart contract to a .nef file", + Usage: "Compile a smart contract to a .nef file", UsageText: "neo-go contract compile -i path [-o nef] [-v] [-d] [-m manifest] [-c yaml] [--bindings file] [--no-standards] [--no-events] [--no-permissions] [--guess-eventtypes]", Description: `Compiles given smart contract to a .nef file and emits other associated information (manifest, bindings configuration, debug information files) if @@ -167,29 +167,29 @@ func NewCommands() []cli.Command { }, cli.BoolFlag{ Name: "no-standards", - Usage: "do not check compliance with supported standards", + Usage: "Do not check compliance with supported standards", }, cli.BoolFlag{ Name: "no-events", - Usage: "do not check emitted events with the manifest", + Usage: "Do not check emitted events with the manifest", }, cli.BoolFlag{ Name: "no-permissions", - Usage: "do not check if invoked contracts are allowed in manifest", + Usage: "Do not check if invoked contracts are allowed in manifest", }, cli.BoolFlag{ Name: "guess-eventtypes", - Usage: "guess event types for smart-contract bindings configuration from the code usages", + Usage: "Guess event types for smart-contract bindings configuration from the code usages", }, cli.StringFlag{ Name: "bindings", - Usage: "output file for smart-contract bindings configuration", + Usage: "Output file for smart-contract bindings configuration", }, }, }, { Name: "deploy", - Usage: "deploy a smart contract (.nef with description)", + Usage: "Deploy a smart contract (.nef with description)", UsageText: "neo-go contract deploy -r endpoint -w wallet [-a address] [-g gas] [-e sysgas] --in contract.nef --manifest contract.manifest.json [--out file] [--force] [--await] [data]", Description: `Deploys given contract into the chain. The gas parameter is for additional gas to be added as a network fee to prioritize the transaction. The data @@ -204,7 +204,7 @@ func NewCommands() []cli.Command { generateRPCWrapperCmd, { Name: "invokefunction", - Usage: "invoke deployed contract on the blockchain", + Usage: "Invoke deployed contract on the blockchain", UsageText: "neo-go contract invokefunction -r endpoint -w wallet [-a address] [-g gas] [-e sysgas] [--out file] [--force] [--await] scripthash [method] [arguments...] [--] [signers...]", Description: `Executes given (as a script hash) deployed script with the given method, arguments and signers. Sender is included in the list of signers by default @@ -219,7 +219,7 @@ func NewCommands() []cli.Command { }, { Name: "testinvokefunction", - Usage: "invoke deployed contract on the blockchain (test mode)", + Usage: "Invoke deployed contract on the blockchain (test mode)", UsageText: "neo-go contract testinvokefunction -r endpoint [--historic index/hash] scripthash [method] [arguments...] [--] [signers...]", Description: `Executes given (as a script hash) deployed script with the given method, arguments and signers (sender is not included by default). If no method is given @@ -250,63 +250,63 @@ func NewCommands() []cli.Command { }, { Name: "init", - Usage: "initialize a new smart-contract in a directory with boiler plate code", + Usage: "Initialize a new smart-contract in a directory with boiler plate code", UsageText: "neo-go contract init -n name [--skip-details]", Action: initSmartContract, Flags: []cli.Flag{ cli.StringFlag{ Name: "name, n", - Usage: "name of the smart-contract to be initialized", + Usage: "Name of the smart-contract to be initialized", }, cli.BoolFlag{ Name: "skip-details, skip", - Usage: "skip filling in the projects and contract details", + Usage: "Skip filling in the projects and contract details", }, }, }, { Name: "inspect", - Usage: "creates a user readable dump of the program instructions", + Usage: "Creates a user readable dump of the program instructions", UsageText: "neo-go contract inspect -i file [-c]", Action: inspect, Flags: []cli.Flag{ cli.BoolFlag{ Name: "compile, c", - Usage: "compile input file (it should be go code then)", + Usage: "Compile input file (it should be go code then)", }, cli.StringFlag{ Name: "in, i", - Usage: "input file of the program (either .go or .nef)", + Usage: "Input file of the program (either .go or .nef)", }, }, }, { Name: "calc-hash", - Usage: "calculates hash of a contract after deployment", + Usage: "Calculates hash of a contract after deployment", UsageText: "neo-go contract calc-hash -i nef -m manifest -s address", Action: calcHash, Flags: []cli.Flag{ flags.AddressFlag{ Name: "sender, s", - Usage: "sender script hash or address", + Usage: "Sender script hash or address", }, cli.StringFlag{ Name: "in", - Usage: "path to NEF file", + Usage: "Path to NEF file", }, cli.StringFlag{ Name: "manifest, m", - Usage: "path to manifest file", + Usage: "Path to manifest file", }, }, }, { Name: "manifest", - Usage: "manifest-related commands", + Usage: "Manifest-related commands", Subcommands: []cli.Command{ { Name: "add-group", - Usage: "adds group to the manifest", + Usage: "Adds group to the manifest", UsageText: "neo-go contract manifest add-group -w wallet [--wallet-config path] -n nef -m manifest -a address -s address", Action: manifestAddGroup, Flags: manifestAddGroupFlags, diff --git a/cli/txctx/tx.go b/cli/txctx/tx.go index a012d10f8..498439373 100644 --- a/cli/txctx/tx.go +++ b/cli/txctx/tx.go @@ -23,17 +23,17 @@ var ( // GasFlag is a flag used for the additional network fee. GasFlag = flags.Fixed8Flag{ Name: "gas, g", - Usage: "network fee to add to the transaction (prioritizing it)", + Usage: "Network fee to add to the transaction (prioritizing it)", } // SysGasFlag is a flag used for the additional system fee. SysGasFlag = flags.Fixed8Flag{ Name: "sysgas, e", - Usage: "system fee to add to the transaction (compensating for execution)", + Usage: "System fee to add to the transaction (compensating for execution)", } // OutFlag is a flag used for file output. OutFlag = cli.StringFlag{ Name: "out", - Usage: "file (JSON) to put signature context with a transaction to", + Usage: "File (JSON) to put signature context with a transaction to", } // ForceFlag is a flag used to force transaction send. ForceFlag = cli.BoolFlag{ @@ -43,7 +43,7 @@ var ( // AwaitFlag is a flag used to wait for the transaction to be included in a block. AwaitFlag = cli.BoolFlag{ Name: "await", - Usage: "wait for the transaction to be included in a block", + Usage: "Wait for the transaction to be included in a block", } ) diff --git a/cli/util/convert.go b/cli/util/convert.go index 4205edd9a..49b69fa9a 100644 --- a/cli/util/convert.go +++ b/cli/util/convert.go @@ -21,7 +21,7 @@ func NewCommands() []cli.Command { txCancelFlags := append([]cli.Flag{ flags.AddressFlag{ Name: "address, a", - Usage: "address to use as conflicting transaction signee (and gas source)", + Usage: "Address to use as conflicting transaction signee (and gas source)", }, txctx.GasFlag, txctx.AwaitFlag, @@ -95,11 +95,11 @@ func NewCommands() []cli.Command { Flags: []cli.Flag{ cli.StringFlag{ Name: "in, i", - Usage: "input file containing base64- or hex- encoded script representation", + Usage: "Input file containing base64- or hex- encoded script representation", }, cli.BoolFlag{ Name: "hex", - Usage: "use hex encoding and do not check base64", + Usage: "Use hex encoding and do not check base64", }, }, }, diff --git a/cli/vm/vm.go b/cli/vm/vm.go index e9e1e2a58..ca7a5a11f 100644 --- a/cli/vm/vm.go +++ b/cli/vm/vm.go @@ -17,7 +17,7 @@ func NewCommands() []cli.Command { cfgFlags = append(cfgFlags, options.Network...) return []cli.Command{{ Name: "vm", - Usage: "start the virtual machine", + Usage: "Start the virtual machine", Action: startVMPrompt, Flags: cfgFlags, }} diff --git a/cli/wallet/nep11.go b/cli/wallet/nep11.go index 9fcce1a86..072d81381 100644 --- a/cli/wallet/nep11.go +++ b/cli/wallet/nep11.go @@ -48,7 +48,7 @@ func newNEP11Commands() []cli.Command { return []cli.Command{ { Name: "balance", - Usage: "get address balance", + Usage: "Get address balance", UsageText: "balance -w wallet [--wallet-config path] --rpc-endpoint [--timeout