Add numeric and others validations for options
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 118
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Describe the Enhancement:
At present, there is no way to add validation criteria while defining the options params for example if the option only accepts integer we need to validate by providing some option params.
It will also cover https://github.com/chef/mixlib-cli/issues/38
Describe the Need:
In https://github.com/chef/chef/pull/8489 we realized we need to pass an integer to Train, but we realized we should probably ensure the users are giving us an integer when we require that.
I don't see an existing pattern in Chef right now. Maybe it's a simple single line or maybe it's a pattern we make a mixin. Let's add validation to each of the command line options that should be numeric though.
For example, --connection-port, --winrm-session-timeout, --max-wait.
Maybe a mixlib-cli option that would let you specify that it should be numeric, and maybe the acceptable range? I kind of thought we already had something like that.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the mixlib-cli option-definition and processing paths, then review the need described in issue 38 and the examples --connection-port, --winrm-session-timeout, and --max-wait. Determine the scope for numeric and range validation before implementing it. Done means command-line options can declare validation criteria and reject invalid values consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100