Sha256: 14e06c589dfcca7bb0f8bd9dfb6edf65fdedabee7b5eca6cfe961cb3061dfce2

Contents?: true

Size: 1.57 KB

Versions: 12

Compression:

Stored size: 1.57 KB

Contents

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

class Trepan::SubSubcommand::SetMaxWidth < Trepan::SubSubcommand
  unless defined?(HELP)
    HELP         = 'Set max[imum] width NUMBER

Set number of characters the debugger thinks are in a line.'
    IN_LIST      = true
    MIN_ABBREV   = 'wid'.size
    NAME         = File.basename(__FILE__, '.rb')
    PREFIX       = %w(set max width)
    SHORT_HELP   = 'Set number of characters the debugger thinks are in a line'
  end

  def run(args)
    args.shift
    run_set_int(args.join(' '),
                "The '#{PREFIX.join(' ')}' command requires a line width", 
                0, nil)
  end

  alias save_command save_command_from_settings

end

if __FILE__ == $0
  # Demo it.
  require_relative '../../../mock'
  name = File.basename(__FILE__, '.rb')

  dbgr, set_cmd = MockDebugger::setup('set')
  max_cmd       = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor, 
                                                      set_cmd)
  cmd_ary       = Trepan::SubSubcommand::SetMaxWidth::PREFIX
  cmd_name      = cmd_ary.join(' ')
  subcmd        = Trepan::SubSubcommand::SetMaxWidth.new(set_cmd.proc,
                                                         max_cmd,
                                                         cmd_name)
  prefix_run = cmd_ary[1..-1]
  subcmd.run(prefix_run)
  subcmd.run(prefix_run + %w(0))
  subcmd.run(prefix_run + %w(20))
  name = File.basename(__FILE__, '.rb')
  subcmd.summary_help(name)
  puts
  puts '-' * 20
  puts subcmd.save_command
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
trepanning-1.93.35 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-1.93.32 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.1.6 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.1.4 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.1.3 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.1.2 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.1.1 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.1.0 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.0.9 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.0.8 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.0.6 processor/command/set_subcmd/max_subcmd/width.rb
trepanning-0.0.4 processor/command/set_subcmd/max_subcmd/width.rb