Daniel <dbk...@gmail.com> added the comment:

If you write a handler for EOF like so:

from cmd import Cmd

class FooShell(Cmd):
        def do_EOF(self, args):
                # exit on EOF
                raise SystemExit()

shell = FooShell()
shell.cmdloop()

Then when running the shell, you can see "EOF" as an undocumented command in 
the help screen. You can see this when typing "?".

$ python fooshell.py
(Cmd) ?

Documented commands (type help <topic>):
========================================
help

Undocumented commands:
======================
EOF

I believe the correct behaviour should be (1) don't show it in the undocumented 
commands, since it's not really a command; and (2) maybe create a built-in 
command for this, since the literal string "EOF" is also caught by this handler.

----------
nosy: +boompig
versions: +Python 3.6 -Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue13214>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to