TritonDataCenter / node-manta

Node.js SDK for Manta
75 stars 54 forks source link

improvements to CLI -h/--help output #284

Closed trentm closed 8 years ago

trentm commented 8 years ago

The plan is to update ot recent dashdash and cmdln and do some improvements to -h/--help output for the manta CLIs:

$ mjob create -X
mjob create: error: unknown option: "-X"
usage: mjob create [ --help | -h ] [ --verbose | -v ]
    [ --account=ACCOUNT | -a ACCOUNT ] [ --subuser=USER | --user=USER ]
    [ --role=ROLE,ROLE,... ] [ --insecure | -i ] [ --keyId=FP | -k FP ]
    [ --url=URL | -u URL ] [ --batch=BATCH_SIZE | -b BATCH_SIZE ]
    [ --cat-outputs | -o ] [ --close ] [ --name=NAME | -n NAME ] [ --open ]
    [ --parallel=CONCURRENCY | -p CONCURRENCY ] [ --quiet | -q ]
    [ --watch | -w ] [ --file=FILE | -f FILE ] [ --map=CMD | -m CMD ]
    [ --reduce=CMD | -r CMD ] [ --asset=ASSET_PATH | -s ASSET_PATH ]
    [ --count=REDUCERS ] [ --disk=DISK_GB ] [ --image=IMAGE_SEMVER ]
    [ --init=INIT_COMMAND ] [ --memory=MEMORY_MB ] ...

and (2) invalid subcommand name: error help showing possible matches:

$ mjob craete -o 'grep foo'
mjob: error: unknown command: "craete"
Did you mean this?
    create
trentm commented 8 years ago

@cburroughs A note on the change in mchmod:

Removing allowUnknown in mchmod because it allows ambiguity like this, where '-x' here is an accidental fat finger of an option.

$ mchmod -x +myrole
mchmod: InvalidPathError: +myrole is not a valid Manta path

That's just confusing. Without allowUnknown:

$ mchmod -x +myrole
unknown option: "-x"
usage: mchmod [OPTIONS] -- [+-=]role,... path...
options:
...
trentm commented 8 years ago

Fixed in commit 67668734f7c5533c24bda1e9f8a5c8d098b21dc1