ManageIQ / ManageIQ/optimist

each_arg method handle never happened cases

Open
#183 2 comments 0 reactions 1 assignee View on GitHub

@Fryguy is already working on this.

Since May 7, 2025.

technical debt
Dominant language
Ruby
Stars
259
Forks
35
PR merge metrics
No merged PRs in 30d

Description

The only place to call `each_arg` return 0/1/param_size, I thought the below logic seems never be used:
https://github.com/ManageIQ/optimist/blob/master/lib/optimist.rb#L373

```
num_params_taken = yield args[i], params

if num_params_taken.nil?
remains << args[i]
if @stop_on_unknown
return remains += args[i + 1..-1]
end
else
i += num_params_taken
end
```
https://github.com/ManageIQ/optimist/blob/master/lib/optimist.rb#L594

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.