File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ def run(argv)
19
19
case subcommand
20
20
when 'report'
21
21
subcommand_report ( argv )
22
+ when 'annotate'
23
+ subcommand_annotate ( argv )
22
24
when 'serve'
23
25
subcommand_serve ( argv )
24
26
when 'version'
@@ -77,6 +79,26 @@ def subcommand_report(argv)
77
79
return 0
78
80
end
79
81
82
+ def subcommand_annotate ( argv )
83
+ options = { }
84
+ option_parser = OptionParser . new do |opts |
85
+ opts . banner = "Usage: pf2 report [options] COMMAND"
86
+ opts . on ( '-h' , '--help' , 'Prints this help' ) do
87
+ puts opts
88
+ return 0
89
+ end
90
+ opts . on ( '-d' , '--source-directory DIR' , 'Path to the source directory' ) do |dir |
91
+ options [ :source_directory ] = dir
92
+ end
93
+ end
94
+ option_parser . parse! ( argv )
95
+
96
+ profile = Marshal . load ( File . binread ( argv [ 0 ] ) )
97
+ Pf2 ::Reporter ::Annotate . new ( profile , options [ :source_directory ] || '.' ) . annotate
98
+
99
+ return 0
100
+ end
101
+
80
102
def subcommand_serve ( argv )
81
103
options = { }
82
104
option_parser = OptionParser . new do |opts |
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
+ require_relative './reporter/annotate'
3
4
require_relative './reporter/stack_weaver'
4
5
require_relative './reporter/firefox_profiler'
5
6
require_relative './reporter/firefox_profiler_ser2'
You can’t perform that action at this time.
0 commit comments