rapid7/metasploit-framework — pull request #3628 by iquaba (2014-08-07 18:52:39+00:00)
Title: Adds --ask option to confirm before exiting msfconsole

The goal is to help people when they forget where they are and accidently type "exit" on msfconsole.
New msfconsole -h entry:
* -a, --ask Ask before exiting Metasploit or accept 'exit -y'

New prompt when typing 'exit' or 'quit' at msfconsole with --ask specified. It accepts variations of y and yes, defaults to no, and is bypassed with 'exit -y':
* Are you sure you want to exit Metasploit? [y/N]:

Validated by testing "exit" and "exit -y" with and without the --ask option and with/without active sessions.