byebug 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/.travis.yml +0 -5
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/LICENSE +23 -20
- data/byebug.gemspec +5 -5
- data/ext/byebug/breakpoint.c +102 -134
- data/ext/byebug/byebug.c +110 -64
- data/ext/byebug/byebug.h +2 -3
- data/ext/byebug/context.c +72 -39
- data/lib/byebug.rb +34 -38
- data/lib/byebug/command.rb +19 -24
- data/lib/byebug/commands/breakpoints.rb +11 -12
- data/lib/byebug/commands/catchpoint.rb +1 -1
- data/lib/byebug/commands/control.rb +2 -4
- data/lib/byebug/commands/finish.rb +1 -1
- data/lib/byebug/commands/frame.rb +15 -17
- data/lib/byebug/commands/info.rb +29 -28
- data/lib/byebug/commands/irb.rb +23 -21
- data/lib/byebug/commands/method.rb +4 -4
- data/lib/byebug/commands/reload.rb +8 -6
- data/lib/byebug/commands/set.rb +27 -23
- data/lib/byebug/commands/show.rb +6 -4
- data/lib/byebug/commands/stepping.rb +2 -2
- data/lib/byebug/commands/threads.rb +10 -10
- data/lib/byebug/commands/trace.rb +13 -14
- data/lib/byebug/commands/variables.rb +14 -12
- data/lib/byebug/context.rb +2 -15
- data/lib/byebug/interface.rb +5 -0
- data/lib/byebug/processor.rb +59 -64
- data/lib/byebug/version.rb +2 -1
- data/old_doc/Makefile +20 -0
- data/{man/rdebug.1 → old_doc/byebug.1} +5 -5
- data/old_doc/byebug.html +6178 -0
- data/old_doc/byebug.texi +3775 -0
- data/{doc → old_doc}/hanoi.rb +0 -0
- data/{doc → old_doc}/primes.rb +0 -0
- data/{doc → old_doc}/test-tri2.rb +0 -0
- data/{doc → old_doc}/tri3.rb +0 -0
- data/{doc → old_doc}/triangle.rb +0 -0
- data/test/breakpoints_test.rb +96 -60
- data/test/conditions_test.rb +15 -12
- data/test/examples/info.rb +5 -5
- data/test/examples/stepping.rb +1 -1
- data/test/frame_test.rb +40 -39
- data/test/info_test.rb +105 -96
- data/test/irb_test.rb +66 -61
- data/test/jump_test.rb +18 -9
- data/test/list_test.rb +114 -107
- data/test/restart_test.rb +51 -58
- data/test/save_test.rb +8 -7
- data/test/set_test.rb +8 -11
- data/test/show_test.rb +3 -5
- data/test/stepping_test.rb +43 -53
- data/test/support/context.rb +1 -0
- data/test/support/processor.rb +10 -4
- data/test/support/test_dsl.rb +46 -18
- data/test/support/test_interface.rb +8 -5
- data/test/test_helper.rb +2 -2
- data/test/trace_test.rb +123 -124
- metadata +39 -17
- data/AUTHORS +0 -10
- data/doc/rdebug-emacs.texi +0 -1030
@@ -28,7 +28,7 @@ module Byebug
|
|
28
28
|
print "Ruby program #{Byebug::PROG_SCRIPT} not executable... " \
|
29
29
|
"We'll add a call to Ruby.\n"
|
30
30
|
ruby = begin defined?(Gem) ? Gem.ruby : "ruby" rescue "ruby" end
|
31
|
-
rdebug_script = "#{ruby} -I#{$:.join(' -I')} #{
|
31
|
+
rdebug_script = "#{ruby} -I#{$:.join(' -I')} #{Byebug::PROG_SCRIPT}"
|
32
32
|
else
|
33
33
|
rdebug_script = Byebug::PROG_SCRIPT
|
34
34
|
end
|
@@ -52,11 +52,9 @@ module Byebug
|
|
52
52
|
argv = Command.settings[:argv]
|
53
53
|
end
|
54
54
|
end
|
55
|
-
|
55
|
+
cmd = "#{rdebug_script} #{argv.compact.join(' ')}"
|
56
56
|
|
57
57
|
# An execv would be preferable to the "exec" below.
|
58
|
-
cmd = "#{rdebug_script} #{args}"
|
59
|
-
p "cmd: #{cmd}"
|
60
58
|
print "Re exec'ing:\n\t#{cmd}\n"
|
61
59
|
exec cmd
|
62
60
|
rescue Errno::EOPNOTSUPP
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Byebug
|
2
2
|
|
3
3
|
# Mix-in module to assist in command parsing.
|
4
|
-
module FrameFunctions
|
4
|
+
module FrameFunctions
|
5
5
|
|
6
6
|
def adjust_frame(frame_pos, absolute, context=@state.context)
|
7
7
|
@state.frame_pos = 0 if context != @state.context
|
@@ -33,7 +33,6 @@ module Byebug
|
|
33
33
|
print_frame(@state.frame_pos, true)
|
34
34
|
end
|
35
35
|
|
36
|
-
# XXX: Implement args and locals for this to be used...
|
37
36
|
def get_frame_call(prefix, pos, context)
|
38
37
|
id = context.frame_method(pos)
|
39
38
|
klass = context.frame_class(pos)
|
@@ -92,23 +91,22 @@ module Byebug
|
|
92
91
|
end
|
93
92
|
end
|
94
93
|
|
95
|
-
frame_num = "
|
96
|
-
|
97
|
-
file_line = "at line
|
94
|
+
frame_num = "##{pos}"
|
95
|
+
call_str = get_frame_call(frame_num, pos, context)
|
96
|
+
file_line = "at line #{CommandProcessor.canonic_file(file)}:#{line}\n"
|
98
97
|
print frame_num
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
# end
|
105
|
-
#end
|
106
|
-
print file_line
|
107
|
-
if ENV['EMACS'] && adjust
|
108
|
-
fmt = (Byebug.annotate.to_i > 1 ?
|
109
|
-
"\032\032source %s:%d\n" : "\032\032%s:%d\n")
|
110
|
-
print fmt % [CommandProcessor.canonic_file(file), line]
|
98
|
+
unless call_str.empty?
|
99
|
+
print call_str
|
100
|
+
if call_str.size + frame_num.size + file_line.size > self.class.settings[:width]
|
101
|
+
print "\n "
|
102
|
+
end
|
111
103
|
end
|
104
|
+
print file_line
|
105
|
+
#if ENV['EMACS'] && adjust
|
106
|
+
# fmt = (Byebug.annotate.to_i > 1 ?
|
107
|
+
# "\032\032source %s:%d\n" : "\032\032%s:%d\n")
|
108
|
+
# print fmt % [CommandProcessor.canonic_file(file), line]
|
109
|
+
#end
|
112
110
|
end
|
113
111
|
|
114
112
|
# Check if call stack is truncated. This can happen if
|
data/lib/byebug/commands/info.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
module Byebug
|
2
|
-
|
2
|
+
|
3
|
+
module InfoFunctions
|
3
4
|
def info_catch(*args)
|
4
5
|
unless @state.context
|
5
6
|
print "No frame selected.\n"
|
6
7
|
return
|
7
8
|
end
|
8
9
|
if Byebug.catchpoints and not Byebug.catchpoints.empty?
|
9
|
-
# FIXME: show whether Exception is valid or not
|
10
|
-
# print "Exception: is_a?(Class)\n"
|
11
10
|
Byebug.catchpoints.each do |exception, hits|
|
12
|
-
|
13
|
-
|
11
|
+
print "#{exception}: #{exception.is_a?(Class)}\n"
|
12
|
+
#print "#{exception}\n"
|
14
13
|
end
|
15
14
|
else
|
16
15
|
print "No exceptions set to be caught.\n"
|
@@ -24,15 +23,15 @@ module Byebug
|
|
24
23
|
Subcommands =
|
25
24
|
[
|
26
25
|
['args', 1, 'Argument variables of current stack frame'],
|
27
|
-
['breakpoints', 1, 'Status of user-settable breakpoints',
|
28
|
-
Without argument, list info about all breakpoints. With an integer
|
29
|
-
list info on that breakpoint.'],
|
26
|
+
['breakpoints', 1, 'Status of user-settable breakpoints',
|
27
|
+
'Without argument, list info about all breakpoints. With an integer ' \
|
28
|
+
'argument, list info on that breakpoint.'],
|
30
29
|
['catch', 3, 'Exceptions that can be caught in the current stack frame'],
|
31
30
|
['display', 2, 'Expressions to display when program stops'],
|
32
|
-
['file', 4, 'Info about a particular file read in',
|
33
|
-
After the file name is supplied, you can list file attributes that
|
34
|
-
see. Attributes include: "all", "basic", "breakpoint",
|
35
|
-
and "sha1".'],
|
31
|
+
['file', 4, 'Info about a particular file read in',
|
32
|
+
'After the file name is supplied, you can list file attributes that ' \
|
33
|
+
'you wish to see. Attributes include: "all", "basic", "breakpoint", ' \
|
34
|
+
'"lines", "mtime", "path" and "sha1".'],
|
36
35
|
['files', 5, 'File names and timestamps of files read in'],
|
37
36
|
['global_variables', 2, 'Global variables'],
|
38
37
|
['instance_variables', 2,
|
@@ -42,16 +41,18 @@ and "sha1".'],
|
|
42
41
|
['locals', 2, 'Local variables of the current stack frame'],
|
43
42
|
['program', 2, 'Execution status of the program'],
|
44
43
|
['stack', 2, 'Backtrace of the stack'],
|
45
|
-
# ['thread', 6, 'List info about thread NUM',
|
46
|
-
#If no thread number is given, we list info for all threads.
|
47
|
-
|
48
|
-
#information. See "help info threads" for
|
49
|
-
#information. If \'verbose\' appended
|
50
|
-
#stack trace is given for
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
44
|
+
# ['thread', 6, 'List info about thread NUM',
|
45
|
+
# 'If no thread number is given, we list info for all threads. ' \
|
46
|
+
# '\'terse\' and \'verbose\' options are possible. If \'terse\', just ' \
|
47
|
+
# 'give summary thread name information. See "help info threads" for ' \
|
48
|
+
# 'more detail about this summary information. If \'verbose\' appended ' \
|
49
|
+
# 'to the end of the command, then the entire stack trace is given for ' \
|
50
|
+
# 'each thread.'],
|
51
|
+
# ['threads', 7, 'information of currently-known threads',
|
52
|
+
# 'This information includes whether the thread is the current thread ' \
|
53
|
+
# '(+), it\'s suspended ($) or it\'s ignored (!), plus the thread ' \
|
54
|
+
# 'number and the top stack item. If \'verbose\' is given then the ' \
|
55
|
+
# 'entire stack frame is shown.'],
|
55
56
|
['variables', 1,
|
56
57
|
'Local and instance variables of the current stack frame']
|
57
58
|
].map do |name, min, short_help, long_help|
|
@@ -60,11 +61,11 @@ and "sha1".'],
|
|
60
61
|
|
61
62
|
InfoFileSubcommands =
|
62
63
|
[
|
63
|
-
['all', 1, 'All file information available - breakpoints, lines, mtime
|
64
|
-
path and sha1'],
|
64
|
+
['all', 1, 'All file information available - breakpoints, lines, mtime' \
|
65
|
+
', path and sha1'],
|
65
66
|
['basic', 2, 'basic information - path, number of lines'],
|
66
|
-
['breakpoints', 2, 'Show trace line numbers',
|
67
|
-
These are the line number where a breakpoint can be set.'],
|
67
|
+
['breakpoints', 2, 'Show trace line numbers',
|
68
|
+
'These are the line number where a breakpoint can be set.'],
|
68
69
|
['lines', 1, 'Show number of lines in the file'],
|
69
70
|
['mtime', 1, 'Show modification time of file'],
|
70
71
|
['path', 4, 'Show full file path name for file'],
|
@@ -197,7 +198,7 @@ These are the line number where a breakpoint can be set.'],
|
|
197
198
|
LineCache::cache(file, Command.settings[:reload_source_on_change])
|
198
199
|
end
|
199
200
|
|
200
|
-
print "File
|
201
|
+
print "File #{file}"
|
201
202
|
path = LineCache.path(file)
|
202
203
|
if %w(all basic path).member?(subcmd.name) and path != file
|
203
204
|
print " - %s\n", path
|
@@ -390,7 +391,7 @@ These are the line number where a breakpoint can be set.'],
|
|
390
391
|
end
|
391
392
|
obj = debug_eval('self')
|
392
393
|
locals = @state.context.frame_locals(@state.frame_pos)
|
393
|
-
locals[
|
394
|
+
locals[:self] = @state.context.frame_self(@state.frame_pos)
|
394
395
|
locals.keys.sort.each do |name|
|
395
396
|
next if name =~ /^__dbg_/ # skip byebug pollution
|
396
397
|
### FIXME: make a common routine
|
data/lib/byebug/commands/irb.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
require 'irb'
|
2
2
|
|
3
|
-
module IRB
|
4
|
-
|
5
|
-
|
3
|
+
module IRB
|
4
|
+
|
5
|
+
module ExtendCommand
|
6
|
+
class Continue
|
6
7
|
def self.execute(conf)
|
7
8
|
throw :IRB_EXIT, :cont
|
8
9
|
end
|
9
10
|
end
|
10
|
-
class Next
|
11
|
+
class Next
|
11
12
|
def self.execute(conf)
|
12
13
|
throw :IRB_EXIT, :next
|
13
14
|
end
|
14
15
|
end
|
15
|
-
class Step
|
16
|
+
class Step
|
16
17
|
def self.execute(conf)
|
17
18
|
throw :IRB_EXIT, :step
|
18
19
|
end
|
@@ -21,7 +22,7 @@ module IRB # :nodoc:
|
|
21
22
|
ExtendCommandBundle.def_extend_command "cont", :Continue
|
22
23
|
ExtendCommandBundle.def_extend_command "n", :Next
|
23
24
|
ExtendCommandBundle.def_extend_command "step", :Step
|
24
|
-
|
25
|
+
|
25
26
|
def self.start_session(binding)
|
26
27
|
unless @__initialized
|
27
28
|
args = ARGV.dup
|
@@ -30,7 +31,7 @@ module IRB # :nodoc:
|
|
30
31
|
ARGV.replace(args)
|
31
32
|
@__initialized = true
|
32
33
|
end
|
33
|
-
|
34
|
+
|
34
35
|
workspace = WorkSpace.new(binding)
|
35
36
|
|
36
37
|
irb = Irb.new(workspace)
|
@@ -44,12 +45,13 @@ module IRB # :nodoc:
|
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
48
|
+
|
47
49
|
module Byebug
|
48
50
|
|
49
|
-
# Implements byebug "irb" command.
|
51
|
+
# Implements byebug's "irb" command.
|
50
52
|
class IRBCommand < Command
|
51
53
|
|
52
|
-
register_setting_get(:autoirb) do
|
54
|
+
register_setting_get(:autoirb) do
|
53
55
|
IRBCommand.always_run
|
54
56
|
end
|
55
57
|
register_setting_set(:autoirb) do |value|
|
@@ -61,7 +63,7 @@ module Byebug
|
|
61
63
|
(?:\s+(-d))?
|
62
64
|
\s*$/x
|
63
65
|
end
|
64
|
-
|
66
|
+
|
65
67
|
def execute
|
66
68
|
unless @state.interface.kind_of?(LocalInterface)
|
67
69
|
print "Command is available only in local mode.\n"
|
@@ -73,20 +75,20 @@ module Byebug
|
|
73
75
|
end
|
74
76
|
|
75
77
|
add_debugging = @match.is_a?(MatchData) && '-d' == @match[1]
|
76
|
-
$
|
78
|
+
$byebug_state = @state if add_debugging
|
77
79
|
$rdebug_in_irb = true
|
78
80
|
cont = IRB.start_session(get_binding)
|
79
81
|
case cont
|
80
82
|
when :cont
|
81
|
-
@state.proceed
|
83
|
+
@state.proceed
|
82
84
|
when :step
|
83
85
|
force = Command.settings[:force_stepping]
|
84
|
-
@state.context.step
|
85
|
-
@state.proceed
|
86
|
+
@state.context.step 1, force
|
87
|
+
@state.proceed
|
86
88
|
when :next
|
87
89
|
force = Command.settings[:force_stepping]
|
88
|
-
@state.context.step_over
|
89
|
-
@state.proceed
|
90
|
+
@state.context.step_over 1, @state.frame_pos, force
|
91
|
+
@state.proceed
|
90
92
|
else
|
91
93
|
file = @state.context.frame_file(0)
|
92
94
|
line = @state.context.frame_line(0)
|
@@ -96,10 +98,10 @@ module Byebug
|
|
96
98
|
|
97
99
|
ensure
|
98
100
|
$rdebug_in_irb = nil
|
99
|
-
$
|
101
|
+
$byebug_state = nil if add_debugging
|
100
102
|
trap("SIGINT", save_trap) if save_trap
|
101
103
|
end
|
102
|
-
|
104
|
+
|
103
105
|
class << self
|
104
106
|
def help_command
|
105
107
|
'irb'
|
@@ -109,10 +111,10 @@ module Byebug
|
|
109
111
|
%{
|
110
112
|
irb [-d]\tstarts an Interactive Ruby (IRB) session.
|
111
113
|
|
112
|
-
If -d is added you can get access to byebug state via the global variable
|
113
|
-
$
|
114
|
+
If -d is added you can get access to byebug's state via the global variable
|
115
|
+
$byebug_state.
|
114
116
|
|
115
|
-
irb is extended with methods "cont", "n" and "step" which
|
117
|
+
irb is extended with methods "cont", "n" and "step" which
|
116
118
|
run the corresponding byebug commands. In contrast to the real byebug
|
117
119
|
commands these commands don't allow command arguments.
|
118
120
|
}
|
@@ -7,7 +7,7 @@ module Byebug
|
|
7
7
|
have_methodsig = false
|
8
8
|
end
|
9
9
|
|
10
|
-
# Implements
|
10
|
+
# Implements byebug's 'method sig' command.
|
11
11
|
class MethodSigCommand < Command
|
12
12
|
def regexp
|
13
13
|
/^\s*m(?:ethod)?\s+sig(?:nature)?\s+(\S+)\s*$/
|
@@ -39,7 +39,7 @@ module Byebug
|
|
39
39
|
end
|
40
40
|
end if have_methodsig
|
41
41
|
|
42
|
-
# Implements
|
42
|
+
# Implements byebug's 'method' command.
|
43
43
|
class MethodCommand < Command
|
44
44
|
def regexp
|
45
45
|
/^\s*m(?:ethod)?\s+((iv)|(i(:?nstance)?)\s+)?/
|
@@ -53,14 +53,14 @@ module Byebug
|
|
53
53
|
end
|
54
54
|
elsif @match[1]
|
55
55
|
obj = debug_eval(@match.post_match)
|
56
|
-
print "%s\n", columnize(obj.methods.sort(),
|
56
|
+
print "%s\n", columnize(obj.methods.sort(),
|
57
57
|
self.class.settings[:width])
|
58
58
|
else
|
59
59
|
obj = debug_eval(@match.post_match)
|
60
60
|
unless obj.kind_of? Module
|
61
61
|
print "Should be Class/Module: %s\n", @match.post_match
|
62
62
|
else
|
63
|
-
print "%s\n", columnize(obj.instance_methods(false).sort(),
|
63
|
+
print "%s\n", columnize(obj.instance_methods(false).sort(),
|
64
64
|
self.class.settings[:width])
|
65
65
|
end
|
66
66
|
end
|
@@ -1,30 +1,32 @@
|
|
1
1
|
module Byebug
|
2
|
+
|
2
3
|
# Implements byebug "reload" command.
|
3
4
|
class ReloadCommand < Command
|
4
5
|
self.allow_in_control = true
|
5
6
|
|
6
|
-
register_setting_get(:reload_source_on_change) do
|
7
|
+
register_setting_get(:reload_source_on_change) do
|
7
8
|
Byebug.reload_source_on_change
|
8
9
|
end
|
10
|
+
|
9
11
|
register_setting_set(:reload_source_on_change) do |value|
|
10
12
|
Byebug.reload_source_on_change = value
|
11
13
|
end
|
12
|
-
|
14
|
+
|
13
15
|
def regexp
|
14
16
|
/^\s*r(?:eload)?$/
|
15
17
|
end
|
16
|
-
|
18
|
+
|
17
19
|
def execute
|
18
20
|
Byebug.source_reload
|
19
21
|
print "Source code is reloaded. Automatic reloading is #{source_reloading}.\n"
|
20
22
|
end
|
21
|
-
|
23
|
+
|
22
24
|
private
|
23
|
-
|
25
|
+
|
24
26
|
def source_reloading
|
25
27
|
Byebug.reload_source_on_change ? 'on' : 'off'
|
26
28
|
end
|
27
|
-
|
29
|
+
|
28
30
|
class << self
|
29
31
|
def help_command
|
30
32
|
'reload'
|
data/lib/byebug/commands/set.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
module Byebug
|
2
|
+
|
2
3
|
# Implements byebug "set" command.
|
3
4
|
class SetCommand < Command
|
4
5
|
SubcmdStruct2=Struct.new(:name, :min, :is_bool, :short_help,
|
@@ -6,33 +7,34 @@ module Byebug
|
|
6
7
|
Subcommands =
|
7
8
|
[
|
8
9
|
['annotate', 2, false, "Set annotation level",
|
9
|
-
|
10
|
-
2 == output annotated suitably for use by programs that control
|
10
|
+
'0 == normal. ' \
|
11
|
+
'2 == output annotated suitably for use by programs that control ' \
|
12
|
+
'byebug.'],
|
11
13
|
['args', 2, false,
|
12
|
-
|
13
|
-
"Follow this command with any number of args, to be passed to the program."],
|
14
|
+
'Set argument list to give program being debugged when it is started'],
|
14
15
|
['autoeval', 4, true, "Evaluate every unrecognized command"],
|
15
16
|
['autolist', 4, true, "Execute 'list' command on every breakpoint"],
|
16
17
|
['autoirb', 4, true, "Invoke IRB on every stop"],
|
17
18
|
['autoreload', 4, true, "Reload source code when changed"],
|
18
19
|
['basename', 1, true, "Report file basename only showing file names"],
|
19
20
|
['callstyle', 2, false, "Set how you want call parameters displayed"],
|
20
|
-
['byebugtesting', 8, false, "Used when testing
|
21
|
+
['byebugtesting', 8, false, "Used when testing byebug"],
|
21
22
|
['forcestep', 2, true,
|
22
|
-
|
23
|
+
'Make sure \'next/step\' commands always move to a new line'],
|
23
24
|
['fullpath', 2, true, "Display full file names in frames"],
|
24
25
|
['history', 2, false,
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
set history
|
26
|
+
'Generic command for setting command history parameters',
|
27
|
+
'set history filename -- Set the filename in which to record the ' \
|
28
|
+
'command history. ' \
|
29
|
+
'set history save -- Set saving of the history record on exit. ' \
|
30
|
+
'set history size -- Set the size of the command history'],
|
29
31
|
['linetrace+', 10, true,
|
30
|
-
|
32
|
+
'Set line execution tracing to show different lines'],
|
31
33
|
['linetrace', 3, true, "Set line execution tracing"],
|
32
34
|
['listsize', 3, false, "Set number of source lines to list by default"],
|
33
35
|
['trace', 1, true, "Display stack trace when 'eval' raises exception"],
|
34
36
|
['width', 1, false,
|
35
|
-
|
37
|
+
'Number of characters per line for byebug\'s output']
|
36
38
|
].map do |name, min, is_bool, short_help, long_help|
|
37
39
|
SubcmdStruct2.new(name, min, is_bool, short_help, long_help)
|
38
40
|
end unless defined?(Subcommands)
|
@@ -96,14 +98,13 @@ set history size -- Set the size of the command history"],
|
|
96
98
|
if args[0]
|
97
99
|
arg = args[0].downcase.to_sym
|
98
100
|
case arg
|
99
|
-
when :short, :last
|
101
|
+
when :short, :last, :tracked
|
100
102
|
Command.settings[:callstyle] = arg
|
101
|
-
|
102
|
-
|
103
|
+
else
|
104
|
+
print "Invalid call style #{arg}. Should be one of: " \
|
105
|
+
"'short', 'last' or 'tracked'.\n"
|
103
106
|
end
|
104
107
|
end
|
105
|
-
print "Invalid call style #{arg}. Should be one of: " +
|
106
|
-
"'short' or 'last'.\n"
|
107
108
|
when /^trace$/
|
108
109
|
Command.settings[:stack_trace_on_error] = set_on
|
109
110
|
when /^fullpath$/
|
@@ -126,15 +127,18 @@ set history size -- Set the size of the command history"],
|
|
126
127
|
when /^save$/
|
127
128
|
interface.history_save = get_onoff(args[1])
|
128
129
|
when /^size$/
|
129
|
-
interface.history_length =
|
130
|
-
|
130
|
+
interface.history_length =
|
131
|
+
get_int(args[1], "Set history size")
|
131
132
|
when /^filename$/
|
132
|
-
interface.histfile =
|
133
|
+
interface.histfile =
|
134
|
+
File.join(ENV["HOME"]||ENV["HOMEPATH"]||".", args[1])
|
133
135
|
else
|
134
|
-
print "Invalid history parameter #{args[0]}. Should be
|
136
|
+
print "Invalid history parameter #{args[0]}. Should be " \
|
137
|
+
"'filename', 'save' or 'size'.\n"
|
135
138
|
end
|
136
139
|
else
|
137
|
-
print "Need two parameters for 'set history'; got
|
140
|
+
print "Need two parameters for 'set history'; got " \
|
141
|
+
"#{args.size}.\n"
|
138
142
|
return
|
139
143
|
end
|
140
144
|
when /^linetrace\+$/
|
@@ -160,7 +164,7 @@ set history size -- Set the size of the command history"],
|
|
160
164
|
print "Unknown setting #{@match[1]}.\n"
|
161
165
|
return
|
162
166
|
end
|
163
|
-
print "
|
167
|
+
print "#{show_setting(try_subcmd.name)}\n"
|
164
168
|
return
|
165
169
|
rescue RuntimeError
|
166
170
|
return
|