informalsystems / themis-contract

A command line-based parameterized contracting tool
Apache License 2.0
46 stars 5 forks source link

Add command aliases into inline command help #4

Open shonfeder opened 4 years ago

shonfeder commented 4 years ago

The longish command names have short aliases, but these don't seem to be visible to the user from the help menu.

thanethomson commented 4 years ago

This seems to be the way that oclif works, and I can't find any other way of showing the aliases at the base-level help:

> neat-contract -h
Neat Enterprise As Text - Contracting

VERSION
  neat-contract/0.1.4 darwin-x64 node-v12.16.1

USAGE
  $ neat-contract [COMMAND]

COMMANDS
  compile              compile a contract to produce a PDF
  gen-sigimages        generates signature images from their cryptographic signatures
  help                 display help for neat-contract
  list-counterparties  prints a table of all counterparties and their IDs
  list-identities      prints a table of all of your saved identities
  list-signatories     prints a table of all signatories for a specific counterparty and their IDs
  new                  create a new contract
  rm-counterparty      remove a counterparty from your local profile
  save-counterparty    saves a counterparty to your profile for easy retrieval later
  save-identity        saves an identity in your profile for use with signing contracts
  save-signatory       saves a counterparty's signatory in your profile
  sign                 sign a contract
  verify               verify all cryptographic signatures on a contract

Compare this to:

> neat-contract save-identity -h
saves an identity in your profile for use with signing contracts

USAGE
  $ neat-contract save-identity

OPTIONS
  -h, --help                   show CLI help
  -p, --profile=profile        [default: /Users/thane/.neat/contract] your local profile path (for managing identities, templates, etc.)
  -v, --verbose                increase output logging verbosity to DEBUG level
  --id=id                      a reference for identity to save (snake_case)
  --keybaseid=keybaseid        optionally specify this identity's keybase ID (can be used for multiple identities)
  --keybasekeyid=keybasekeyid  optionally specify this identity's keybase key ID (can be used for multiple identities)
  --overwrite                  overwrite the identity if it exists
  --sigfull=sigfull            optional path to image to use for a full signature
  --siginitials=siginitials    optional path to image to use for signing initials

ALIASES
  $ neat-contract si

EXAMPLES
  $ neat-contract save-identity --id manderson
  $ neat-contract si --id manderson

where there's an ALIASES section in the help.

shonfeder commented 4 years ago

This helps!

Could we add something that tells the user they can run neat-contract <command> --help? We could also put the alias in the subcommand description, tho I'm not sure that's the best option.