Ignore config if todo formatter is used

Fixes #53
This commit is contained in:
Vitalii Elenhaupt 2018-05-11 21:38:41 +03:00
parent 4546b90b54
commit 6579c8f573
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
2 changed files with 7 additions and 0 deletions

View file

@ -47,6 +47,12 @@ module Ameba::Cli
c.formatter.should eq :todo c.formatter.should eq :todo
end end
it "ignores --config if --gen-config flag passed" do
c = Cli.parse_args %w(--gen-config --config my_config.yml)
c.formatter.should eq :todo
c.config.should eq ""
end
it "accepts unknown args as files" do it "accepts unknown args as files" do
c = Cli.parse_args %w(source1.cr source2.cr) c = Cli.parse_args %w(source1.cr source2.cr)
c.files.should eq %w(source1.cr source2.cr) c.files.should eq %w(source1.cr source2.cr)

View file

@ -59,6 +59,7 @@ module Ameba::Cli
parser.on("--gen-config", parser.on("--gen-config",
"Generate a configuration file acting as a TODO list") do "Generate a configuration file acting as a TODO list") do
opts.formatter = :todo opts.formatter = :todo
opts.config = ""
end end
end end