Skip to content

Using '=' to choose arguments breaks multi-line inputs for type 'string' #138

Open
@thmsdmmrtn

Description

@thmsdmmrtn

My code needs to input multi-line strings as a single value.
Entirety of the test code I created to test this issue:

require 'optimist'
opts = Optimist::options do
  opt :foo, 'foobar', short:none, type: :string
end
puts "foo is #{opts[:foo]}"

Command that works:

ruby rubyfile.rb --foo "bar
baz
qux" 

Output of command that works:

foo is bar
baz
qux

Command that produces error:

ruby rubyfile.rb --foo="bar
baz
qux" 

Output of command that produces error:

foo is bar

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions