Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add numeric and others validations for options

未关闭
#70 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
ruby
领域
cli

调研方向

首先阅读 mixlib-cli 的选项定义和处理路径,然后查看 issue 38 中描述的需求以及 --connection-port、--winrm-session-timeout 和 --max-wait 示例。在实现之前,确定数值验证和范围验证的范围。完成标准是命令行选项可以声明验证条件,并一致地拒绝无效值。

由索引模型根据 Issue 内容生成。

描述

Triage: Feature Request
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.

主要语言
Ruby
星标
118
派生
40
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

chef/mixlib-cli 的其他 Issue

查看 chef/mixlib-cli 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。