ETCDEVTeam/emerald-vault-archive

$ emerald <command> --help

Closed this issue · 1 comments

I think it would be really useful to provide some specific help information for each command (including one example with most basic possible use, and one with ultra-fancy use).

Further, to provide some kind of information about units for each required arg. For example,

~/dev/etc/emerald-cli master= ⟠ emerald transaction --help
Invalid arguments.

Usage:
  emerald server    [--port=<port>] [--host=<host>] [--base-path=<path>] [-v | --verbose] [-q | --quite]
  emerald new       --chain=<chain>  ([[--security-level=<level>] [--name=<name>] [--description=<description>]] | --raw <key>)
  emerald list      --chain=<chain>  [--show-hidden]
  emerald hide      --chain=<chain>  <address>
  emerald unhide    --chain=<chain>  ([-a | --all] | <address>)
  emerald strip     --chain=<chain>  <address>
  emerald import    --chain=<chain>  [-a | --all] [-f | --force] <path>
  emerald export    --chain=<chain>  ([-a | --all] | <address>) <path>
  emerald update    --chain=<chain>  <address> [--name=<name>] [--description=<description>]
  emerald transaction   --chain=<chain> <from> <to> <value> [--gas=<gas>] [--gas-price=<price>] [--data=<data>] (--nonce=<nonce> | --upstream=<upstream>)
  emerald balance   <address> [--upstream=<upstream>]
  emerald -V | --version
  emerald -h | --help

should give something like

emerald transaction   --chain=<chain> <from> <to> <value> [--gas=<gas>] [--gas-price=<price>] [--data=<data>] (--nonce=<nonce> | --upstream=<upstream>)

     --nonce=<nonce> is optional; if not provided you must ensure it will be set by your '--upstream' client
     --gas=<gas> is in 0x-prefixed hex encoding
     ...

     A couple of examples:
          emerald transaction --chain=mainnet 0xblahblah 0xblahblah 100000
          emerald transaction --chan=morden 0xblahblah 0xblahblah 0x539000 --gas-price=0x21000 --gas=0x2100000 --data="Happy birthday" --upstream=127.0.0.1:8545


... Because I have questions like

  • "Is <gas> in hex, wei, or ether?"
  • "I'm assuming <data> is 0x-hex-encoded? (But it would be cool if I could leave a message real easy there for my buddy like ':beers: on me')"
  • "Can I use my --name for my account instead of an address for <from>?"
r8d8 commented

docopt isn't suitable for subcommand help, maybe we can use some alternative in future.