-
Notifications
You must be signed in to change notification settings - Fork 3
Description
The current Waterfall CLI (0.3.2) provides a way for the CommandSpec.data.accepts to define a list of acceptable items the user may specify on the input, but, it limits the user to only selecting a single item.
When the CommandSpec.data omits the accepts property, whatever is supplied is passed through to the CLI verb processing code without doing any validation checks at all. This means the client is required to validate, and is responsible for output having a consistent appearance.
It would be nice to have a way to indicate that multiple of the provided accepts items are allowed, so that the validity checks will be done by Waterfall CLI.
This would have a nice benefit in terms of making the usage of the --help more consistent too. When the accepts property is given, Waterfall CLI generates the output to incorporate that list. Not using the accepts means one has to leverage the description property to describe the list of available options, and the output is not quite the same.
eg:
- Output with
acceptsundefined:
Peters-MBP:main-stack peterbelbin$ spark test --help
Description: Run tests against some aspect of the project
Usage: spark test [flags] [data]
FLAGS:
--version, -v Show version
--help, -h Show help
DATA:
What to test: subset of: api, admin, cst, mt (required)
Peters-MBP:main-stack peterbelbin$
- Output with
acceptsdefined:
Peters-MBP:main-stack peterbelbin$ spark test --help
Description: Run tests against some aspect of the project
Usage: spark test [flags] [data]
FLAGS:
--version, -v Show version
--help, -h Show help
DATA:
What to test: list of testables (required) (accepts: api, admin, cst, mt)