@@ -740,7 +740,8 @@ def help
740
740
* 'ruby' which uses the current Ruby executable in the PATH
741
741
Default value is --use jvm, therefore all commands run on truffleruby-jvm by default.
742
742
The default can be changed with `export RUBY_BIN=RUBY_SELECTOR`
743
- --silent Does not print the command and which Ruby is used
743
+ --silent|-q Does not print the command and which Ruby is used
744
+ --verbose|-v Print more details and commands
744
745
--jdk Specifies which version of the JDK should be used: 11 (default) or 17
745
746
746
747
jt build [graalvm|parser|options|core-symbols] ... by default it builds graalvm
@@ -826,7 +827,7 @@ def help
826
827
Ruby and cache the result, such as benchmark bench/mri/bm_vm1_not.rb --cache
827
828
jt benchmark bench/mri/bm_vm1_not.rb --use-cache
828
829
jt profile profiles an application, including the TruffleRuby runtime, and generates a flamegraph
829
- jt graph [ruby options] [--method Object#foo] [--watch] [--no-simplify] file.rb
830
+ jt graph [ruby options] [--method Object#foo] [--watch] [--no-simplify] file.rb [-- seafoam options]
830
831
render a graph of Object#foo within file.rb
831
832
--describe describe the shape of the graph (linear, branches, loops, calls, deopts)
832
833
jt igv launches IdealGraphVisualizer
@@ -2045,6 +2046,7 @@ def graph(*args)
2045
2046
simplify = true
2046
2047
describe = false
2047
2048
json = false
2049
+ seafoam_args = [ ]
2048
2050
2049
2051
vm_args , remaining_args , _parsed_options = ruby_options ( { } , args )
2050
2052
args = remaining_args
@@ -2064,7 +2066,8 @@ def graph(*args)
2064
2066
when '--describe'
2065
2067
describe = true
2066
2068
when '--'
2067
- raise
2069
+ seafoam_args = args . dup
2070
+ args . clear
2068
2071
when /^-/
2069
2072
vm_args << arg
2070
2073
else
@@ -2102,7 +2105,7 @@ def graph(*args)
2102
2105
loop do # for --watch
2103
2106
compiled = false
2104
2107
command = [ ruby_launcher , *vm_args , test_file ]
2105
- # STDERR.puts bold "$ #{printable_cmd(command)}"
2108
+ STDERR . puts bold "$ #{ printable_cmd ( command ) } " if @verbose
2106
2109
IO . popen ( command , err : [ :child , :out ] ) do |pipe |
2107
2110
pipe . each_line do |line |
2108
2111
puts line
@@ -2132,7 +2135,7 @@ def graph(*args)
2132
2135
2133
2136
json_args = json ? %w[ --json ] : [ ]
2134
2137
action = describe ? 'describe' : 'render'
2135
- run_gem_test_pack_gem_or_install ( 'seafoam' , SEAFOAM_VERSION , *json_args , "#{ graph } :#{ n } " , action )
2138
+ run_gem_test_pack_gem_or_install ( 'seafoam' , SEAFOAM_VERSION , *json_args , "#{ graph } :#{ n } " , action , * seafoam_args )
2136
2139
2137
2140
break unless watch
2138
2141
puts # newline between runs
@@ -2960,6 +2963,7 @@ def process_pre_args(args)
2960
2963
needs_build = false
2961
2964
needs_rebuild = false
2962
2965
@silent = false
2966
+ @verbose = false
2963
2967
@jdk_version = Integer ( ENV [ 'JT_JDK' ] || 11 )
2964
2968
2965
2969
until args . empty?
@@ -2973,6 +2977,8 @@ def process_pre_args(args)
2973
2977
@ruby_name = args . shift
2974
2978
when '-q' , '--silent'
2975
2979
@silent = true
2980
+ when '-v' , '--verbose'
2981
+ @verbose = true
2976
2982
when '--jdk'
2977
2983
@jdk_version = Integer ( args . shift )
2978
2984
when '-h' , '-help' , '--help'
0 commit comments