module Byebug::ThreadFunctions

def parse_thread_num_for_cmd(subcmd, arg)

def parse_thread_num_for_cmd(subcmd, arg)
  c = parse_thread_num(subcmd, arg)
  return nil unless c
  case
  when nil == c
    errmsg 'No such thread'
  when @state.context == c
    errmsg "It's the current thread"
  when c.ignored?
    errmsg "Can't #{subcmd} thread #{arg}"
  else
    return c
  end
  return nil
end