Skip to content

Commit 43bf3a7

Browse files
committed
feat(cli): support formats via --out; allow filename for output; update help and tests
1 parent 48ffe6c commit 43bf3a7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

lib/skunk/cli/options/argv.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ def parse
2727
Skunk::Config.formats = formats.map(&:to_sym)
2828
end
2929

30+
opts.on("--out-file FILE", "Output report to file") do |filename|
31+
self.output_filename = filename
32+
end
33+
3034
opts.on_tail("-v", "--version", "Show gem's version") do
3135
self.mode = :version
3236
end

test/lib/skunk/application_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
end
4747

4848
context "when passing an environment variable SHARE=true" do
49-
let(:argv) { ["--out=tmp/shared_report.txt", "samples/rubycritic"] }
49+
let(:argv) { ["--out-file=tmp/shared_report.txt", "samples/rubycritic"] }
5050
let(:success_code) { 0 }
5151
let(:shared_message) do
5252
"Shared at: https://skunk.fastruby.io/j"

test/lib/skunk/commands/help_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
<<~HELP
1212
Usage: skunk [options] [paths]
1313
-b, --branch BRANCH Set branch to compare
14-
-o, --out FILE Output report to file
14+
-o, --out console,json,html Output formats
15+
--out-file FILE Output report to file
1516
-v, --version Show gem's version
1617
-h, --help Show this message
1718
HELP

0 commit comments

Comments
 (0)