Lumail - The console email client


Lua primitives: prompt_yn()

NOTE: Lumail-legacy has been superseded by Lumail 2.x, which has a wholly unified Lua API.

The bottom row of the lumail mail-client is designated as the message area, but it is also used to prompt for input.

The prompt_yn() function allows you to query a user for a response which is either "yes" or "no"..

For example:

input = prompt_yn( "Do you wish to send the mail?" );
msg( "The result was: " .. input );

You'll notice that prompt_yn() is a special case of the prompt_chars() function. For example you could emulate prompt_yn() like so:

function yes_no(prompt_str)
   ret = prompt_chars( prompt_str, "ynYN" )
   if ( ret == 'y' || ret == 'Y' ) then
     return true
   else
     return false
   end
end

Availability

This function has been available since version 0.07.

See Also

See also choose_string, prompt, prompt_chars, prompt_maildir.