Sha256: c6feadadae7172f043e15d89905b9914b584b0e8168e5daec3536adcd1111e0f

Contents?: true

Size: 1.26 KB

Versions: 9

Compression:

Stored size: 1.26 KB

Contents

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

class Trepan::Command::SetCommand < Trepan::SubcommandMgr
  unless defined?(HELP)
    NAME          = File.basename(__FILE__, '.rb')
    HELP = <<-HELP
Modifies parts of the debugger environment.

You can give unique prefix of the name of a subcommand to get
information about just that subcommand.

Type "#{NAME}" for a list of "#{NAME}" subcommands and what they do.
Type "help #{NAME} *" for just the list of "#{NAME}" subcommands.

For compatability with older ruby-debug "#{NAME} auto..." is the
same as "#{NAME} auto ...". For example "#{NAME} autolist" is the same 
as "#{NAME} auto list".
    HELP

    CATEGORY      = 'support'
    NEED_STACK    = false
    SHORT_HELP    = 'Modify parts of the debugger environment'
  end

  def run(args)
    if args.size > 1 
      first = args[1].downcase
      alen = 'auto'.size
      args[1..1] = ['auto', first[alen..-1]] if
        first.start_with?('auto') && first.size > alen
    end
    super
  end

end

if __FILE__ == $0
  require_relative '../mock'
  dbgr, cmd = MockDebugger::setup
  cmd.run([cmd.name])
  cmd.run([cmd.name, 'autolist'])
  cmd.run([cmd.name, 'autoeval', 'off'])
  cmd.run([cmd.name, 'basename'])
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trepanning-0.1.6 processor/command/set.rb
trepanning-0.1.4 processor/command/set.rb
trepanning-0.1.3 processor/command/set.rb
trepanning-0.1.2 processor/command/set.rb
trepanning-0.1.1 processor/command/set.rb
trepanning-0.1.0 processor/command/set.rb
trepanning-0.0.9 processor/command/set.rb
trepanning-0.0.8 processor/command/set.rb
trepanning-0.0.6 processor/command/set.rb