-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add output-json option #23
Conversation
lib/xcprofiler.rb
Outdated
@@ -28,6 +28,7 @@ def execute(args) | |||
opts.on("--derived-data-path", String, "Root path of DerivedData") { |v| options.derived_data_path = v } | |||
opts.on("-t", "--truncate-at [TRUNCATE_AT]", Integer, "Truncate the method name with specified length") { |v| options.truncate_at = v } | |||
opts.on("--[no-]unique", "Reject duplicated location results or not") { |v| options.unique = v } | |||
opts.on("--output-path [PATH]", String, "File path to output reporters' result") { |v| options.output_path = v } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be -o and --output.
At least -path is needless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-o
is already used. So I renamed to --output
lib/xcprofiler.rb
Outdated
if options[:output_path] | ||
json_args = options.dup | ||
json_args[:output_path] = options[:output_path] | ||
reporters << JSONReporter.new(json_args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No other style? Only JSON?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, only JSON
Is there no test? Maybe you could add the test that generates temporary output JSON and has a validation of regex-match. |
There are no tests parsing options. I'm going to add them later. |
@timakin I fixed. |
LGTM |
❤️ |
closes #20
Add command line option
--output-path
. You can specify the path indicates output path forJSONReporter
.$ xcprofiler --output-path "result.json" MyApp