Long options that start with `--no-*` are negated even when its explicitly defined as an option
还没有人认领这个 Issue。
评估
调研方向
从 lib/mixlib/cli.rb 中报告的第 290 行附近的 opt_parser 和 parse_options 路径开始。使用 sensu-plugins-disk-checks 命令配合 --no-smart-capable-disks 重现失败,然后验证显式定义的选项能够解析而不会触发 false.to_sym 异常。
由索引模型根据 Issue 内容生成。
描述
Version:
mixlib-cli-1.7.0
Environment:
Unsure see: https://github.com/sensu-plugins/sensu-plugins-disk-checks/issues/94
Scenario:
Use an arg such as --no-smart-capable-disks with a -
Steps to Reproduce:
- clone repo: https://github.com/sensu-plugins/sensu-plugins-disk-checks
- run
bundle - run script:
$ bundle exec ./bin/check-smart.rb --no-smart-capable-disks
Check failed to run: undefined method `to_sym' for false:FalseClass
Did you mean? to_s, ["/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:290:in `block (3 levels) in opt_parser'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/2.4.0/optparse.rb:1552:in `block in parse_in_order'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/2.4.0/optparse.rb:1538:in `catch'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/2.4.0/optparse.rb:1538:in `parse_in_order'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/2.4.0/optparse.rb:1532:in `order!'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/2.4.0/optparse.rb:1626:in `permute!'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/2.4.0/optparse.rb:1648:in `parse!'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:230:in `parse_options'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sensu-plugin-1.4.5/lib/sensu-plugin/cli.rb:13:in `initialize'", "./bin/check-smart.rb:138:in `initialize'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sensu-plugin-1.4.5/lib/sensu-plugin/cli.rb:57:in `new'", "/home/babrams/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sensu-plugin-1.4.5/lib/sensu-plugin/cli.rb:57:in `block in <class:CLI>'"]
Expected Result:
Argument should work
Actual Result:
It blows up and does not parse the arguments properly
- 主要语言
- Ruby
- 星标
- 118
- 派生
- 40
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
chef/mixlib-cli 的其他 Issue
-
Triage: Feature Request
难度 5/5 一周以上 新手友好度 25/100
chef/mixlib-cli#70 ·
-
Triage: Feature Request
难度 4/5 3-5 天 新手友好度 35/100
chef/mixlib-cli#69 ·
-
Triage: Feature Request
难度 4/5 3-5 天 新手友好度 25/100
chef/mixlib-cli#38 · 1 条评论 ·
-
Triage: Feature Request
难度 5/5 一周以上 新手友好度 20/100
chef/mixlib-cli#27 ·
相似的 Issue
-
Windows: packaged_agent_ruby? never matches 'Puppet Labs\Puppet', so the openvox gem is not found未关闭
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 78/100
puppetlabs/puppetlabs-postgresql#1721 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
temporalio/sdk-ruby#625 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 94/100
zerocracy/judges-action#2803 ·
维护者通常 5 天内回复