You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have a scenario where you have both optional arguments and a type: :array argument, the help incorrectly displays the optional arguments at the end of the usage, even though the catch-all array argument will get the value.
To Reproduce
require'bundler/inline'gemfiledosource'https://rubygems.org'gem'dry-cli'endrequire'dry/cli'moduleMyCLIextendDry::CLI::RegistryclassTest < Dry::CLI::Commandargument:first,required: trueargument:second,required: false# important: this one is optionalargument:catch_all,type: :array,required: truedefcall(**kwargs)pkwargsendendregister"test",TestendDry::CLI.new(MyCLI).call
Actual behavior
➜ playground ruby repro.rb test --help
Command:
repro.rb test
Usage:
repro.rb test FIRST CATCH_ALL [SECOND]
Arguments:
FIRST # REQUIRED
SECOND #
CATCH_ALL # REQUIRED
Options:
--help, -h # Print this help
➜ playground ruby repro.rb test first second third
{:first=>"first", :second=>"second", :catch_all=>["third"], :args=>["third"]}
Expected behavior
Usage:
repro.rb test FIRST [SECOND] CATCH_ALL
My environment
Affects my production application: YES
Ruby version: 3.3
OS: Mac, Linux
The text was updated successfully, but these errors were encountered:
Describe the bug
When you have a scenario where you have both optional arguments and a
type: :array
argument, the help incorrectly displays the optional arguments at the end of the usage, even though the catch-all array argument will get the value.To Reproduce
Actual behavior
Expected behavior
My environment
The text was updated successfully, but these errors were encountered: