module Byebug::ParseFunctions
def get_int(str, cmd, min=nil, max=nil, default=1)
min and max. If either min or max is nil, that
Parse 'str' of command 'cmd' as an integer between
def get_int(str, cmd, min=nil, max=nil, default=1) return default unless str begin int = Integer(str) if min and int < min print "\"#{cmd}\" argument \"#{str}\" needs to be at least #{min}.\n" return nil elsif max and int > max print "\"#{cmd}\" argument \"#{str}\" needs to be at most #{max}.\n" return nil end return int rescue print "\"#{cmd}\" argument \"#{str}\" needs to be a number.\n" return nil end end