trepanning 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. data/ChangeLog +161 -0
  2. data/NEWS +10 -0
  3. data/Rakefile +13 -19
  4. data/app/frame.rb +1 -1
  5. data/app/irb.rb +1 -1
  6. data/app/util.rb +3 -10
  7. data/data/irbrc +1 -1
  8. data/lib/trepanning.rb +2 -2
  9. data/processor/command/alias.rb +10 -11
  10. data/processor/command/backtrace.rb +8 -9
  11. data/processor/command/base/cmd.rb +4 -0
  12. data/processor/command/base/subcmd.rb +0 -1
  13. data/processor/command/base/submgr.rb +12 -3
  14. data/processor/command/break.rb +14 -15
  15. data/processor/command/condition.rb +11 -12
  16. data/processor/command/continue.rb +10 -11
  17. data/processor/command/debug.rb +7 -8
  18. data/processor/command/delete.rb +10 -9
  19. data/processor/command/directory.rb +1 -1
  20. data/processor/command/disable.rb +8 -9
  21. data/processor/command/disassemble.rb +7 -8
  22. data/processor/command/display.rb +10 -11
  23. data/processor/command/down.rb +8 -9
  24. data/processor/command/enable.rb +9 -10
  25. data/processor/command/exit.rb +11 -10
  26. data/processor/command/finish.rb +12 -11
  27. data/processor/command/frame.rb +3 -4
  28. data/processor/command/help.rb +14 -16
  29. data/processor/command/info.rb +7 -8
  30. data/processor/command/irb.rb +13 -14
  31. data/processor/command/kill.rb +21 -10
  32. data/processor/command/list.rb +36 -36
  33. data/processor/command/macro.rb +4 -5
  34. data/processor/command/next.rb +19 -20
  35. data/processor/command/nocache.rb +3 -4
  36. data/processor/command/{print.rb → pr.rb} +11 -9
  37. data/processor/command/ps.rb +8 -8
  38. data/processor/command/quit.rb +17 -15
  39. data/processor/command/raise.rb +11 -10
  40. data/processor/command/reload.rb +4 -5
  41. data/processor/command/restart.rb +11 -10
  42. data/processor/command/save.rb +12 -9
  43. data/processor/command/set.rb +14 -15
  44. data/processor/command/set_subcmd/debug_subcmd/dbgr.rb +1 -1
  45. data/processor/command/set_subcmd/debug_subcmd/skip.rb +1 -1
  46. data/processor/command/show.rb +7 -7
  47. data/processor/command/show_subcmd/alias.rb +3 -4
  48. data/processor/command/show_subcmd/args.rb +0 -2
  49. data/processor/command/show_subcmd/auto.rb +2 -3
  50. data/processor/command/show_subcmd/basename.rb +0 -3
  51. data/processor/command/show_subcmd/debug.rb +2 -1
  52. data/processor/command/show_subcmd/debug_subcmd/dbgr.rb +1 -1
  53. data/processor/command/show_subcmd/different.rb +0 -3
  54. data/processor/command/show_subcmd/events.rb +0 -2
  55. data/processor/command/show_subcmd/macro.rb +2 -5
  56. data/processor/command/show_subcmd/max.rb +2 -1
  57. data/processor/command/show_subcmd/trace.rb +2 -2
  58. data/processor/command/source.rb +9 -8
  59. data/processor/command/step.rb +28 -29
  60. data/processor/command/stepi.rb +1 -1
  61. data/processor/command/unalias.rb +4 -5
  62. data/processor/command/undisplay.rb +4 -5
  63. data/processor/command/up.rb +9 -10
  64. data/processor/eval.rb +6 -2
  65. data/processor/frame.rb +32 -26
  66. data/processor/main.rb +1 -1
  67. data/processor/mock.rb +9 -3
  68. data/processor/running.rb +11 -7
  69. data/processor/validate.rb +1 -2
  70. data/test/functional/test-fn_helper.rb +42 -0
  71. data/test/functional/test-raise.rb +1 -1
  72. data/test/functional/test-return.rb +2 -2
  73. data/test/unit/test-app-util.rb +3 -4
  74. data/test/unit/test-base-subcmd.rb +2 -1
  75. data/test/unit/test-cmd-help.rb +4 -4
  76. data/test/unit/test-proc-frame.rb +1 -2
  77. data/test/unit/test-proc-main.rb +1 -1
  78. metadata +10 -7
@@ -27,7 +27,6 @@ class Trepan
27
27
  # which append current settings to list output.
28
28
  MIN_ABBREV = 1
29
29
  NEED_STACK = false
30
- NAME = 'your_command_name'
31
30
  end
32
31
 
33
32
 
@@ -43,6 +43,7 @@ class Trepan::SubcommandMgr < Trepan::Command
43
43
  # Initialization
44
44
  cmd_names = []
45
45
  subcmd_names = []
46
+ cmd_basenames = []
46
47
  cmd_dir = File.dirname(__FILE__)
47
48
  subcmd_dir = File.join(cmd_dir, '..', name + '_subcmd')
48
49
  files = Dir.glob(File.join(subcmd_dir, '*.rb'))
@@ -52,15 +53,23 @@ class Trepan::SubcommandMgr < Trepan::Command
52
53
  subcmd_names << name.capitalize + basename.capitalize
53
54
  else
54
55
  cmd_names << name.capitalize + basename.capitalize
56
+ cmd_basenames << basename
55
57
  end
56
58
  require rb
57
59
  end if File.directory?(subcmd_dir)
58
60
 
59
61
  subcommands = {}
60
- cmd_names.each do |name|
62
+ cmd_names.each_with_index do |name, i|
61
63
  next unless Trepan::Subcommand.constants.member?(name.to_sym)
62
- subcmd_class = "Trepan::Subcommand::#{name}.new(self)"
63
- cmd = self.instance_eval(subcmd_class)
64
+ subcmd_class = self.instance_eval("Trepan::Subcommand::#{name}")
65
+ unless subcmd_class.const_defined?(:NAME)
66
+ subcmd_class.const_set(:NAME, cmd_basenames[i])
67
+ end
68
+ unless subcmd_class.const_defined?(:PREFIX)
69
+ subcmd_class.const_set(:PREFIX, %W(#{parent.name} #{cmd_basenames[i]}))
70
+ end
71
+ subcmd_new_str = "Trepan::Subcommand::#{name}.new(self)"
72
+ cmd = self.instance_eval(subcmd_new_str)
64
73
  cmd_name = cmd.name
65
74
  @subcmds.add(cmd)
66
75
  end
@@ -5,27 +5,27 @@ require_relative '../../app/breakpoint'
5
5
  class Trepan::Command::BreakCommand < Trepan::Command
6
6
 
7
7
  unless defined?(HELP)
8
- HELP =
9
- 'break [line number|offset]
8
+ NAME = File.basename(__FILE__, '.rb')
9
+ HELP = <<-HELP
10
+ #{NAME} [line number|offset]
10
11
 
11
12
  With a line number argument, set a break there in the current
12
13
  instruction sequence. With an offset (a number prefaced with an "O")
13
14
  set a breakpoint at that instruction offset.
14
15
 
15
16
  Examples:
16
- break
17
- break 10 # set breakpoint on line 10
18
- break o20 # set breakpoint VM Instruction Sequence offset 20
19
- '
17
+ #{NAME}
18
+ #{NAME} 10 # set breakpoint on line 10
19
+ #{NAME} o20 # set breakpoint VM Instruction Sequence offset 20
20
+ HELP
20
21
 
21
22
  ALIASES = %w(b)
22
23
  CATEGORY = 'breakpoints'
23
- NAME = File.basename(__FILE__, '.rb')
24
24
  SHORT_HELP = 'Set a breakpoint'
25
25
  end
26
26
 
27
27
  # This method runs the command
28
- def run(args) # :nodoc
28
+ def run(args)
29
29
  # FIXME: handle more conditions
30
30
  # a line number
31
31
  if args.size == 1
@@ -69,17 +69,16 @@ end
69
69
 
70
70
  if __FILE__ == $0
71
71
  require_relative '../mock'
72
- name = File.basename(__FILE__, '.rb')
73
- dbgr, cmd = MockDebugger::setup(name)
74
- cmd.run([name])
75
- cmd.run([name, __LINE__.to_s])
72
+ dbgr, cmd = MockDebugger::setup
73
+ cmd.run([cmd.name])
74
+ cmd.run([cmd.name, __LINE__.to_s])
76
75
  require 'thread_frame'
77
76
  tf = RubyVM::ThreadFrame.current
78
77
  pc_offset = tf.pc_offset
79
- cmd.run([name, "O#{pc_offset}"])
78
+ cmd.run([cmd.name, "O#{pc_offset}"])
80
79
  def foo
81
80
  5
82
81
  end
83
- cmd.run([name, 'foo', (__LINE__-2).to_s])
84
- cmd.run([name, 'foo'])
82
+ cmd.run([cmd.name, 'foo', (__LINE__-2).to_s])
83
+ cmd.run([cmd.name, 'foo'])
85
84
  end
@@ -8,8 +8,9 @@ require_relative '../../app/condition'
8
8
  class Trepan::Command::ConditionCommand < Trepan::Command
9
9
 
10
10
  unless defined?(HELP)
11
- HELP =
12
- 'condition BP_NUMBER CONDITION
11
+ NAME = File.basename(__FILE__, '.rb')
12
+ HELP = <<-HELP
13
+ #{NAME} BP_NUMBER CONDITION
13
14
 
14
15
  BP_NUMBER is a breakpoint number. CONDITION is an expression which
15
16
  must evaluate to True before the breakpoint is honored. If CONDITION
@@ -17,14 +18,13 @@ is absent, any existing condition is removed; i.e., the breakpoint is
17
18
  made unconditional.
18
19
 
19
20
  Examples:
20
- condition 5 x > 10 # Breakpoint 5 now has condition x > 10
21
- condition 5 # Remove above condition
22
- '
21
+ #{NAME} 5 x > 10 # Breakpoint 5 now has condition x > 10
22
+ #{NAME} 5 # Remove above condition
23
+ HELP
23
24
 
24
25
  ALIASES = %w(cond)
25
26
  CATEGORY = 'breakpoints'
26
27
  MIN_ARGS = 1
27
- NAME = File.basename(__FILE__, '.rb')
28
28
  NEED_STACK = false
29
29
  SHORT_HELP = 'Specify breakpoint number N to break only if COND is true'
30
30
  end
@@ -50,15 +50,14 @@ end
50
50
  if __FILE__ == $0
51
51
  require 'thread_frame'
52
52
  require_relative '../mock'
53
- name = File.basename(__FILE__, '.rb')
54
- dbgr, cmd = MockDebugger::setup(name)
53
+ dbgr, cmd = MockDebugger::setup
55
54
  cmd.proc.frame_setup(RubyVM::ThreadFrame::current)
56
55
 
57
- cmd.run([name, '1'])
56
+ cmd.run([cmd.name, '1'])
58
57
  cmdproc = dbgr.core.processor
59
58
  cmds = cmdproc.commands
60
59
  break_cmd = cmds['break']
61
- break_cmd.run(['break', cmdproc.frame.source_location[0].to_s])
62
- cmd.run([name, '1', 'x' '>' '10'])
63
- cmd.run([name, '1'])
60
+ break_cmd.run([break_cmd.name, cmdproc.frame.source_location[0].to_s])
61
+ cmd.run([cmd.name, '1', 'x' '>' '10'])
62
+ cmd.run([cmd.name, '1'])
64
63
  end
@@ -5,8 +5,9 @@ require_relative '../../app/breakpoint' # FIXME: possibly temporary
5
5
  class Trepan::Command::ContinueCommand < Trepan::Command
6
6
 
7
7
  unless defined?(HELP)
8
- HELP =
9
- 'continue [offset|line number]
8
+ NAME = File.basename(__FILE__, '.rb')
9
+ HELP = <<-HELP
10
+ #{NAME} [offset|line number]
10
11
 
11
12
  Leave the debugger loop and continue execution. Subsequent entry to
12
13
  the debugger however may occur via breakpoints or explicit calls, or
@@ -17,21 +18,20 @@ before continuing. Offset are numbers preficed with an "O" otherwise
17
18
  the parameter is taken as a line number.
18
19
 
19
20
  Examples:
20
- continue
21
- continue 10 # continue to line 10
22
- continue o20 # continue to VM Instruction Sequence offset 20
23
- '
21
+ #{NAME}
22
+ #{NAME} 10 # continue to line 10
23
+ #{NAME} o20 # continue to VM Instruction Sequence offset 20
24
+ HELP
24
25
 
25
26
  ALIASES = %w(c)
26
27
  CATEGORY = 'running'
27
28
  MAX_ARGS = 1 # Need at most this many
28
- NAME = File.basename(__FILE__, '.rb')
29
29
  NEED_RUNNING = true
30
30
  SHORT_HELP = 'Continue execution of debugged program'
31
31
  end
32
32
 
33
33
  # This method runs the command
34
- def run(args) # :nodoc
34
+ def run(args)
35
35
  if args.size == 1
36
36
  # Form is: "continue"
37
37
  @proc.continue
@@ -55,7 +55,6 @@ end
55
55
 
56
56
  if __FILE__ == $0
57
57
  require_relative '../mock'
58
- name = File.basename(__FILE__, '.rb')
59
- dbgr, cmd = MockDebugger::setup(name)
60
- p cmd.run([name])
58
+ dbgr, cmd = MockDebugger::setup
59
+ p cmd.run([cmd.name])
61
60
  end
@@ -5,15 +5,16 @@ require_relative 'base/cmd'
5
5
 
6
6
  class Trepan::Command::DebugCommand < Trepan::Command
7
7
  unless defined?(HELP)
8
- HELP =
9
- "debug RUBY-CODE
8
+ NAME = File.basename(__FILE__, '.rb')
9
+ HELP = <<-HELP
10
+ #{NAME} RUBY-CODE
10
11
 
11
- Enter the debugger recursively on RUBY-CODE."
12
+ Enter the debugger recursively on RUBY-CODE.
13
+ HELP
12
14
 
13
15
  CATEGORY = 'data'
14
16
  MIN_ARGS = 1
15
17
  MAX_ARG = nil
16
- NAME = File.basename(__FILE__, '.rb')
17
18
  NEED_STACK = false
18
19
  SHORT_HELP = 'recursive debugging of an expression'
19
20
 
@@ -76,10 +77,8 @@ end
76
77
 
77
78
  if __FILE__ == $0
78
79
  require_relative '../mock'
79
- name = File.basename(__FILE__, '.rb')
80
- dbgr, cmd = MockDebugger::setup(name)
81
- name = File.basename(__FILE__, '.rb')
80
+ dbgr, cmd = MockDebugger::setup
82
81
  cmd.proc.hidelevels[Thread.current] = 0
83
82
  cmd.proc.frame_setup(RubyVM::ThreadFrame::current)
84
- cmd.run([name, 'x = 1; y = 2'])
83
+ cmd.run([cmd.name, 'x = 1; y = 2'])
85
84
  end
@@ -6,8 +6,11 @@ require_relative '../../app/breakpoint'
6
6
  class Trepan::Command::DeleteCommand < Trepan::Command
7
7
 
8
8
  unless defined?(HELP)
9
- HELP =
10
- 'delete [bpnumber [bpnumber...]] - Delete some breakpoints.
9
+ NAME = File.basename(__FILE__, '.rb')
10
+ HELP = <<-HELP
11
+ #{NAME} [bpnumber [bpnumber...]]
12
+
13
+ Delete some breakpoints.
11
14
 
12
15
  Arguments are breakpoint numbers with spaces in between. To delete
13
16
  all breakpoints, give no argument. those breakpoints. Without
@@ -15,10 +18,9 @@ argument, clear all breaks (but first ask confirmation).
15
18
 
16
19
  See also the "clear" command which clears breakpoints by line/file
17
20
  number.
18
- '
21
+ HELP
19
22
 
20
23
  CATEGORY = 'breakpoints'
21
- NAME = File.basename(__FILE__, '.rb')
22
24
  SHORT_HELP = 'Delete some breakpoints'
23
25
  end
24
26
 
@@ -40,15 +42,14 @@ end
40
42
 
41
43
  if __FILE__ == $0
42
44
  require_relative '../mock'
43
- name = File.basename(__FILE__, '.rb')
44
- dbgr, cmd = MockDebugger::setup(name)
45
- cmd.run([name])
46
- cmd.run([name, '1'])
45
+ dbgr, cmd = MockDebugger::setup
46
+ cmd.run([cmd.name])
47
+ cmd.run([cmd.name, '1'])
47
48
  cmdproc = dbgr.core.processor
48
49
  cmds = dbgr.core.processor.commands
49
50
  break_cmd = cmds['break']
50
51
  break_cmd.run(['break', cmdproc.frame.source_location[0].to_s])
51
52
  # require_relative '../../lib/trepanning'
52
53
  # Trepan.debug(:set_restart => true)
53
- cmd.run([name, '1'])
54
+ cmd.run([cmd.name, '1'])
54
55
  end
@@ -21,7 +21,7 @@ kernel/common/module.rb if have the source code somewhere.
21
21
  end
22
22
 
23
23
  # This method runs the command
24
- def run(args) # :nodoc
24
+ def run(args)
25
25
  if args.size > 1
26
26
  settings[:directory] = "#{args[1]}:#{settings[:directory]}"
27
27
  msg "Source directories searched: #{settings[:directory]}"
@@ -14,15 +14,15 @@ class Trepan::Command::DisableCommand < Trepan::Command
14
14
  # Silence already initialized constant .. warnings
15
15
  old_verbose = $VERBOSE
16
16
  $VERBOSE = nil
17
- HELP =
18
- 'disable [display] bpnumber [bpnumber ...]
17
+ NAME = File.basename(__FILE__, '.rb')
18
+ HELP = <<-HELP
19
+ #{NAME} [display] bpnumber [bpnumber ...]
19
20
 
20
21
  Disables the breakpoints given as a space separated list of breakpoint
21
22
  numbers. See also "info break" to get a list.
22
- '
23
+ HELP
23
24
 
24
25
  CATEGORY = 'breakpoints'
25
- NAME = File.basename(__FILE__, '.rb')
26
26
  SHORT_HELP = 'Disable some breakpoints'
27
27
 
28
28
  $VERBOSE = old_verbose
@@ -51,15 +51,14 @@ end
51
51
 
52
52
  if __FILE__ == $0
53
53
  require_relative '../mock'
54
- name = File.basename(__FILE__, '.rb')
55
- dbgr, cmd = MockDebugger::setup(name)
56
- cmd.run([name])
57
- cmd.run([name, '1'])
54
+ dbgr, cmd = MockDebugger::setup
55
+ cmd.run([cmd.name])
56
+ cmd.run([cmd.name, '1'])
58
57
  cmdproc = dbgr.core.processor
59
58
  cmds = cmdproc.commands
60
59
  break_cmd = cmds['break']
61
60
  break_cmd.run(['break', cmdproc.frame.source_location[0].to_s])
62
61
  # require_relative '../../lib/trepanning'
63
62
  # Trepan.debug(:set_restart => true)
64
- cmd.run([name, '1'])
63
+ cmd.run([cmd.name, '1'])
65
64
  end
@@ -9,8 +9,9 @@ class Trepan::Command::DisassembleCommand < Trepan::Command
9
9
  include Trepanning
10
10
 
11
11
  unless defined?(HELP)
12
- HELP =
13
- "disassemble [thing] [full]
12
+ NAME = File.basename(__FILE__, '.rb')
13
+ HELP = <<-HELP
14
+ #{NAME} [thing] [full]
14
15
 
15
16
  With no argument, disassemble the current frame. With a method,
16
17
  disassemble that method. '.' can be used to indicate the instruction
@@ -27,11 +28,10 @@ Examples:
27
28
  disas . # Same as above
28
29
  disas . full # At least the instruction sequence above but maybe more
29
30
  disas require_relative # disassemble method 'require_relative'
30
- "
31
+ HELP
31
32
 
32
33
  ALIASES = %w(disas disassem) # Note we have disable
33
34
  CATEGORY = 'data'
34
- NAME = File.basename(__FILE__, '.rb')
35
35
  NEED_STACK = true
36
36
  SHORT_HELP = 'Disassemble Ruby VM instructions'
37
37
  end
@@ -88,16 +88,15 @@ if __FILE__ == $0
88
88
  require 'thread_frame'
89
89
 
90
90
  require_relative '../mock'
91
- name = File.basename(__FILE__, '.rb')
92
- dbgr, cmd = MockDebugger::setup(name)
91
+ dbgr, cmd = MockDebugger::setup
93
92
  def small_fn(cmd, name)
94
93
  cmd.proc.frame_setup(RubyVM::ThreadFrame::current)
95
94
  cmd.run [name]
96
95
  end
97
- small_fn(cmd, name)
96
+ small_fn(cmd, cmd.name)
98
97
  p = Proc.new do
99
98
  |x,y| x + y
100
99
  end
101
100
  cmd.proc.frame_setup(RubyVM::ThreadFrame::current)
102
- cmd.run([name, 'p'])
101
+ cmd.run([cmd.name, 'p'])
103
102
  end
@@ -5,8 +5,9 @@ require_relative 'base/cmd'
5
5
  class Trepan::Command::DisplayCommand < Trepan::Command
6
6
 
7
7
  unless defined?(HELP)
8
- HELP = <<EOH
9
- display [format] EXP
8
+ NAME = File.basename(__FILE__, '.rb')
9
+ HELP = <<-HELP
10
+ #{name} [format] EXP
10
11
 
11
12
  Print value of expression EXP each time the program stops. FMT may be
12
13
  used before EXP and may be one of 'c' for char, 'x' for hex, 'o' for
@@ -21,10 +22,9 @@ case or not.
21
22
  With no argument, evaluate and display all currently requested
22
23
  auto-display expressions. Use "undisplay" to cancel display
23
24
  requests previously made.
24
- EOH
25
+ HELP
25
26
 
26
27
  CATEGORY = 'data'
27
- NAME = File.basename(__FILE__, '.rb')
28
28
  NEED_STACK = false
29
29
  SHORT_HELP = 'Display expressions when entering debugger'
30
30
  end
@@ -62,8 +62,7 @@ if __FILE__ == $0
62
62
  # Demo it.
63
63
  require 'thread_frame'
64
64
  require_relative '../mock'
65
- name = File.basename(__FILE__, '.rb')
66
- dbgr, cmd = MockDebugger::setup(name)
65
+ dbgr, cmd = MockDebugger::setup
67
66
 
68
67
  def run_cmd(cmd, args)
69
68
  cmd.run(args)
@@ -72,10 +71,10 @@ if __FILE__ == $0
72
71
 
73
72
  cmd.proc.frame_setup(RubyVM::ThreadFrame::current)
74
73
 
75
- run_cmd(cmd, [name])
76
- run_cmd(cmd, [name, '/x', '10'])
77
- run_cmd(cmd, [name, 'd'])
78
- run_cmd(cmd, [name])
74
+ run_cmd(cmd, [cmd.name])
75
+ run_cmd(cmd, [cmd.name, '/x', '10'])
76
+ run_cmd(cmd, [cmd.name, 'd'])
77
+ run_cmd(cmd, [cmd.name])
79
78
  e = 5
80
- run_cmd(cmd, [name, 'e'])
79
+ run_cmd(cmd, [cmd.name, 'e'])
81
80
  end
@@ -9,14 +9,14 @@ class Trepan::Command::DownCommand < Trepan::Command::UpCommand
9
9
  # Silence already initialized constant .. warnings
10
10
  old_verbose = $VERBOSE
11
11
  $VERBOSE = nil
12
- HELP =
13
- "d(own) [count]
12
+ HELP = <<-HELP
13
+ #{NAME} [count]
14
14
 
15
15
  Move the current frame down in the stack trace (to a newer frame). 0
16
16
  is the most recent frame. If no count is given, move down 1.
17
17
 
18
18
  See also 'up' and 'frame'.
19
- "
19
+ HELP
20
20
 
21
21
  ALIASES = %w(d)
22
22
  NAME = File.basename(__FILE__, '.rb')
@@ -34,14 +34,13 @@ if __FILE__ == $0
34
34
  # Demo it.
35
35
  require 'thread_frame'
36
36
  require_relative '../mock'
37
- name = File.basename(__FILE__, '.rb')
38
- dbgr, cmd = MockDebugger::setup(name)
37
+ dbgr, cmd = MockDebugger::setup
39
38
 
40
39
  def sep ; puts '=' * 40 end
41
- cmd.run [name]
40
+ cmd.run [cmd.name]
42
41
  %w(-1 0 1 -2).each do |count|
43
- puts "#{name} #{count}"
44
- cmd.run([name, count])
42
+ puts "#{cmd.name} #{count}"
43
+ cmd.run([cmd.name, count])
45
44
  sep
46
45
  end
47
46
  def foo(cmd, name)
@@ -52,5 +51,5 @@ if __FILE__ == $0
52
51
  puts "#{name} -1"
53
52
  cmd.run([name, '-1'])
54
53
  end
55
- foo(cmd, name)
54
+ foo(cmd, cmd.name)
56
55
  end