fix up the quit message to be wiseass like python's

This commit is contained in:
Paul Tagliamonte 2013-06-22 22:39:05 -04:00
parent 56bae8cc54
commit e1091afe94
1 changed files with 5 additions and 2 deletions

7
bin/hy
View File

@ -1,7 +1,6 @@
#!/usr/bin/env python
import sys
from hy.cmdline import cmdline_handler
@ -10,7 +9,9 @@ class HyQuitter(object):
self.name = name
def __repr__(self):
self.__call__()
return "Use (%s) or Ctrl-D (i.e. EOF) to exit" % (self.name)
__str__ = __repr__
def __call__(self, code=None):
try:
@ -19,8 +20,10 @@ class HyQuitter(object):
pass
raise SystemExit(code)
__builtins__.quit = HyQuitter('quit')
__builtins__.exit = HyQuitter('exit')
if __name__ == '__main__':
sys.exit(cmdline_handler("hy", sys.argv))