Sha256: a2b2e1fc16560722adf9e55853c6a52da5fd1a9d59976024e576767b5328db20

Contents?: true

Size: 1.08 KB

Versions: 12

Compression:

Stored size: 1.08 KB

Contents

# -*- coding: utf-8 -*-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
require_relative '../../base/subsubcmd'

class Trepan::Subcommand::SetMaxStack < Trepan::SubSubcommand
  unless defined?(HELP)
    HELP         = 'Set number of backtrace lines the debugger will show'
    DEFAULT_MIN  = 3
    MIN_ABBREV   = 'sta'.size
    NAME         = File.basename(__FILE__, '.rb')
    PREFIX       = %w(set max stack)
  end

  def run(args)
    args.shift
    args = %W(#{DEFAULT_MIN}) if args.empty?
    run_set_int(args.join(' '),
                "The '#{PREFIX.join(' ')}'command requires number at least #{DEFAULT_MIN}", 
                DEFAULT_MIN, nil)
  end

  alias save_command save_command_from_settings

end

if __FILE__ == $0
  # Demo it.
  require_relative '../../../mock'
  require_relative '../max'
  cmd = MockDebugger::subsub_setup(Trepan::SubSubcommand::SetMax,
                                   Trepan::SubSubcommand::SetMaxStack, false)
  prefix_run = cmd.prefix[1..-1]
  cmd.run(prefix_run)
  cmd.run(prefix_run + %w(0))
  cmd.run(prefix_run + %w(10))
  puts cmd.save_command
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
trepanning-2.15.35 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-1.93.35 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-2.15.33 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-1.93.32 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-0.1.6 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-0.1.4 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-0.1.3 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-0.1.2 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-0.1.1 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-0.1.0 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-0.0.9 processor/command/set_subcmd/max_subcmd/stack.rb
trepanning-0.0.8 processor/command/set_subcmd/max_subcmd/stack.rb