cli: unify the style of Usage message for VM CLI commands

Usage message is shown on common --help command, thus it should be meaningful
and short. If user needs more detailed command description, then he can use
command-specific help.

As a result, current VM help looks pretty simple:
```
NEO-GO-VM > help
NAME:
   VM CLI - Official VM CLI for Neo-Go

USAGE:
    [global options] command [command options] [arguments...]

VERSION:
   0.99.5-pre-15-g5463ec41

COMMANDS:
   exit          Exit the VM prompt
   ip            Show current instruction
   break         Place a breakpoint
   jump          Jump to the specified instruction (absolute IP value)
   estack        Show evaluation stack contents
   istack        Show invocation stack contents
   sslot         Show static slot contents
   lslot         Show local slot contents
   aslot         Show arguments slot contents
   loadnef       Load a NEF-consistent script into the VM optionally attaching to it provided signers with scopes
   loadbase64    Load a base64-encoded script string into the VM optionally attaching to it provided signers with scopes
   loadhex       Load a hex-encoded script string into the VM optionally attaching to it provided signers with scopes
   loadgo        Compile and load a Go file with the manifest into the VM optionally attaching to it provided signers with scopes
   loadtx        Load transaction into the VM from chain or from parameter context file
   loaddeployed  Load deployed contract into the VM from chain optionally attaching to it provided signers with scopes
   reset         Unload compiled script from the VM and reset context to proper (possibly, historic) state
   parse         Parse provided argument and convert it into other possible formats
   run           Execute the current loaded script
   cont          Continue execution of the current loaded script
   step          Step (n) instruction in the program
   stepinto      Stepinto instruction to take in the debugger
   stepout       Stepout instruction to take in the debugger
   stepover      Stepover instruction to take in the debugger
   ops           Dump opcodes of the current loaded program
   events        Dump events emitted by the current loaded program
   env           Dump state of the chain that is used for VM CLI invocations (use -v for verbose node configuration)
   storage       Dump storage of the contract with the specified hash, address or ID as is at the current stage of script invocation
   changes       Dump storage changes as is at the current stage of loaded script invocation
   help, h       Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

```
This commit is contained in:
Anna Shaleva 2022-10-12 13:21:37 +03:00
parent 884428ab93
commit 62197929f4

View file

@ -189,8 +189,7 @@ Example:
},
{
Name: "loadtx",
Usage: "Load transaction into the VM from chain or from parameter context file. " +
"The transaction script will be loaded into VM; the resulting execution context will use the provided transaction as script container including its signers, hash and nonce.",
Usage: "Load transaction into the VM from chain or from parameter context file",
UsageText: `loadtx [--historic <height>] <file-or-hash>`,
Flags: []cli.Flag{historicFlag},
Description: `loadtx [--historic <height>] <file-or-hash>
@ -204,7 +203,7 @@ The transaction script will be loaded into VM; the resulting execution context w
},
{
Name: "loaddeployed",
Usage: "Load deployed contract into the VM from chain optionally attaching to it provided signers with scopes. If '--historic' flag specified, then the historic contract state (historic script and manifest) will be loaded.",
Usage: "Load deployed contract into the VM from chain optionally attaching to it provided signers with scopes",
UsageText: `loaddeployed [--historic <height>] <hash-or-address-or-id> [<signer-with-scope>, ...]`,
Flags: []cli.Flag{historicFlag},
Description: `loaddeployed [--historic <height>] <hash-or-address-or-id> [<signer-with-scope>, ...]
@ -323,13 +322,7 @@ Example:
},
{
Name: "storage",
Usage: "Dump storage of the contract with the specified hash, address or ID as is at the current stage of script invocation. " +
"Can be used if no script is loaded. " +
"Hex-encoded storage items prefix may be specified (empty by default to return the whole set of storage items). " +
"If seek prefix is not empty, then it's trimmed from the resulting keys." +
"Items are sorted. Backwards seek direction may be specified (false by default, which means forwards storage seek direction). " +
"It is possible to dump only those storage items that were added or changed during current script invocation (use --diff flag for it). " +
"To dump the whole set of storage changes including removed items use 'changes' command.",
Usage: "Dump storage of the contract with the specified hash, address or ID as is at the current stage of script invocation",
UsageText: `storage <hash-or-address-or-id> [<prefix>] [--backwards] [--diff]`,
Flags: []cli.Flag{
cli.BoolFlag{
@ -357,11 +350,7 @@ Example:
},
{
Name: "changes",
Usage: "Dump storage changes as is at the current stage of loaded script invocation. " +
"If no script is loaded or executed, then no changes are present. " +
"The contract hash, address or ID may be specified as the first parameter to dump the specified contract storage changes. " +
"Hex-encoded search prefix (without contract ID) may be specified to dump matching storage changes. " +
"Resulting values are not sorted.",
Usage: "Dump storage changes as is at the current stage of loaded script invocation",
UsageText: `changes [<hash-or-address-or-id> [<prefix>]]`,
Description: `changes [<hash-or-address-or-id> [<prefix>]]