Couchbase-cli -h creates a lot of noise


Currently the CLI feels clumsy and noisy, and is not a pleasure to work with.

If I run couchbase-cli it displays an output of supported commands, e.g.;

usage: couchbase-cli COMMAND CLUSTER [OPTIONS]

CLUSTER is --cluster=HOST[:PORT] or -c HOST[:PORT]

COMMANDs include
  server-list           list all servers in a cluster
  server-info           show details on one server
--- snip ---

If I run couchbase-cli -h, it floods me with details for each command;

xdcr-setup OPTIONS:
  --create                               create a new xdcr configuration
  --edit                                 modify existed xdcr configuration
  --delete                               delete existed xdcr configuration
  --list                                 list all xdcr configurations
  --xdcr-cluster-name=CLUSTERNAME        cluster name

  Remove a node from a cluster and rebalance:
    couchbase-cli rebalance -c \
       --server-remove= \
       -u Administrator -p password

--- 1000 lines of flooded text ---

Ideally what should happen is that -h should be context specific to the command being given.

For example, if I was to run couchbase-cli -h then it should have the same output as without -h. However if I was to run couchbase-cli create-bucket -h, then it should show me the help output specific to that command.

I’ve had a look over the source code, and it would require probably around 4-8 hours of work to get it working. If a core contributor can provide some reassurances that such a PR would be accepted, and also some guidance on whether the suggested changes are acceptable, then I will happily contribute that time to get this done.


Raised in JIRA, see MB-14657


Note this has already been raised via MB-12976 and is fixed in Sherlock.