chef / chef/mixlib-cli

Option validations

Open
#38 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Triage: Feature Request
Dominant language
Ruby
Stars
118
Forks
40
PR merge metrics
No merged PRs in 30d

Description

I have this in my CLI

  option :date,
    short:      "-d DATE",
    long:       "--date DATE",
    required:   true,
    description:  "date in 20171120 format"

Is there a way to add validation for date (and other fields) to ensure that they follow specific pattern?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by locating the option DSL and the CLI argument parsing entry point in mixlib-cli. Determine how an option could express a pattern or validation rule, then verify that invalid values are rejected and valid dates are accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.