Skip to content

Commit

Permalink
Allow embedded newlines in arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
native-api committed Jan 5, 2021
1 parent b577682 commit 3022f56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dpl/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.run(*args)
new(args).run
end

OPTION_PATTERN = /\A--([a-z][a-z_\-]*)(?:=(.+))?\z/
OPTION_PATTERN = /\A--([a-z][a-z_\-]*)(?:=(.+))?\z/m
attr_accessor :options, :fold_count

def initialize(*args)
Expand Down
2 changes: 1 addition & 1 deletion spec/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe "#options" do
example { expect(described_class.new.options[:app]) .to eq(File.basename(Dir.pwd)) }
example { expect(described_class.new(:app => 'foo') .options[:app]).to eq('foo') }
example { expect(described_class.new("--app=foo") .options[:app]).to eq('foo') }
example { expect(described_class.new("--app=foo\nbar") .options[:app]).to eq("foo\nbar") }
example { expect(described_class.new("--app") .options[:app]).to eq(true) }
example { expect(described_class.new("--app=foo", "--app=bar") .options[:app]).to eq(['foo', 'bar']) }

Expand Down

0 comments on commit 3022f56

Please sign in to comment.