Use the GNU Library readline function

Returns null if EOF is read If with_history is true, it will save all commands in the history except empty strings and white characters strings

Property definitions

readline :: readline $ Sys :: readline
# Use the GNU Library readline function
# Returns `null` if EOF is read
# If `with_history` is true, it will save all commands in the history except
# empty strings and white characters strings
fun readline(message: String, with_history: nullable Bool): nullable String do
	var line = native_readline(message.to_cstring)
	if line.address_is_null then return null

	var nit_str = line.to_s

	if with_history != null and with_history then
		if nit_str.trim != "" then native_add_history(line)
	end

	return nit_str
end
lib/readline/readline.nit:42,1--57,3