bin/ruby-prof in ruby-prof-0.7.9 vs bin/ruby-prof in ruby-prof-0.7.10
- old
+ new
@@ -9,10 +9,11 @@
# ruby_prof [options] <script.rb> [--] [script-options]"
#
# Options:
# -p, --printer=printer Select a printer:
# flat - Prints a flat profile as text (default).
+# flat_with_line_numbers - Above, with line numbers
# graph - Prints a graph profile as text.
# graph_html - Prints a graph profile as html.
# call_tree - format for KCacheGrind
# -f, --file=path Output results to a file instead of standard out.
# -m, --min_percent=min_percent The minimum percent a method must take before ',
@@ -33,10 +34,12 @@
# (requires a patched Ruby interpreter).
# --replace-progname Replace $0 when loading the .rb files.
# --specialized-instruction Turn on specialized instruction.
# -h, --help Show help message
# --version Show version
+# -v Show version, set $VERBOSE to true, run file
+# -d Set $DEBUG to true
#
#
# See also: {flat profiles}[link:files/examples/flat_txt.html], {graph profiles}[link:files/examples/graph_txt.html], {html graph profiles}[link:files/examples/graph_html.html]
#
@@ -58,21 +61,25 @@
opts.separator ""
opts.separator "Options:"
- opts.on('-p printer', '--printer=printer', [:flat, :graph, :graph_html, :call_tree],
+ opts.on('-p printer', '--printer=printer', [:flat, :flat_with_line_numbers, :graph, :graph_html, :call_tree],
'Select a printer:',
' flat - Prints a flat profile as text (default).',
+ ' flat_with_line_numbers - same as flat, with line numbers.',
' graph - Prints a graph profile as text.',
' graph_html - Prints a graph profile as html.',
- ' call_tree - format for KCacheGrind' ) do |printer|
+ ' call_tree - format for KCacheGrind'
+ ) do |printer|
case printer
when :flat
options.printer = RubyProf::FlatPrinter
+ when :flat_with_line_numbers
+ options.printer = RubyProf::FlatPrinterWithLineNumbers
when :graph
options.printer = RubyProf::GraphPrinter
when :graph_html
options.printer = RubyProf::GraphHtmlPrinter
when :call_tree
@@ -134,12 +141,22 @@
opts.on_tail("-h", "--help", "Show help message") do
puts opts
exit
end
- opts.on_tail("-v", "--version", "Show version") do
+ opts.on_tail("--version", "Show version #{RubyProf::VERSION}") do
puts "ruby_prof " + RubyProf::VERSION
exit
+ end
+
+ opts.on("-v","Show version, set $VERBOSE to true, profile script") do
+ puts "ruby_prof " + RubyProf::VERSION
+ puts "ruby " + RUBY_DESCRIPTION
+ $VERBOSE= true
+ end
+
+ opts.on("-d", "Set $DEBUG to true") do
+ $DEBUG = true
end
end
begin
opts.parse! ARGV
\ No newline at end of file