CMD-options: OptionParser#on support "--abc STR". implemented for CMD#opt, too.

This commit is contained in:
Denis Knauf 2021-12-31 15:17:46 +01:00
parent ba922fe52c
commit 8fe78bb406

View file

@ -169,11 +169,11 @@ class DenCli::CMD
case opt
when /\A(--\[no-\][^= ]+)\z/
@long, @val = $1, nil
when /\A(--[^=]+)=(.+)\z/
when /\A(--[^= ]+)[= ](.+)\z/
@long, @val = $1, $2 || @val
when /\A(--[^= ]+)\z/
@long, @val = $1, nil
when /\A(-[^=-])=?(.+)\z/
when /\A(-[^= -])[= ]?(.+)\z/
@short, @val = $1, $2 || @val
when /\A(-[^= -])\z/
@short, @val = $1, nil