# class Byebug::DeleteCommand

Implements breakpoint deletion.

### Public Class Methods

description() click to toggle source

    # File lib/byebug/commands/delete.rb, line 40
    def description
      prettify <<-EOD
        del[ete][ nnn...]

        Without and argument, deletes all breakpoints. With integer
        arguments, it deletes specific breakpoints.
      EOD
    end

names() click to toggle source

    # File lib/byebug/commands/delete.rb, line 36
    def names
      %w(delete)
    end

### Public Instance Methods

execute() click to toggle source

    # File lib/byebug/commands/delete.rb, line 15
    def execute
      unless @match[1]
        if confirm(pr('break.confirmations.delete_all'))
          Byebug.breakpoints.clear
        end

        return nil
      end

      @match[1].split(/ +/).each do |number|
        pos, err = get_int(number, 'Delete', 1)

        return errmsg(err) unless pos

        unless Breakpoint.remove(pos)
          return errmsg(pr('break.errors.no_breakpoint_delete', pos: pos))
        end
      end
    end

regexp() click to toggle source

    # File lib/byebug/commands/delete.rb, line 11
    def regexp
      /^\s* del(?:ete)? (?:\s+(.*))?$/x
    end