class Byebug::ThreadSwitchCommand

def description

def description
  %{th[read] [sw[itch]] <nnn>\tswitch thread context to nnn}
end

def execute

def execute
  if @match[1] =~ /switch/
    errmsg '"thread switch" needs a thread number'
    return
  end
  c = parse_thread_num_for_cmd('thread switch', @match[1])
  return unless c
  display_context(c)
  c.step_into 1
  c.thread.run
  @state.proceed
end

def names

def names
  %w(thread)
end

def regexp

def regexp
  /^\s* th(?:read)? \s+ (?:sw(?:itch)?\s+)? (\S+) \s*$/x
end