fix up the quit message to be wiseass like python's
This commit is contained in:
parent
56bae8cc54
commit
e1091afe94
7
bin/hy
7
bin/hy
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from hy.cmdline import cmdline_handler
|
from hy.cmdline import cmdline_handler
|
||||||
|
|
||||||
|
|
||||||
@ -10,7 +9,9 @@ class HyQuitter(object):
|
|||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def __repr__(self):
|
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):
|
def __call__(self, code=None):
|
||||||
try:
|
try:
|
||||||
@ -19,8 +20,10 @@ class HyQuitter(object):
|
|||||||
pass
|
pass
|
||||||
raise SystemExit(code)
|
raise SystemExit(code)
|
||||||
|
|
||||||
|
|
||||||
__builtins__.quit = HyQuitter('quit')
|
__builtins__.quit = HyQuitter('quit')
|
||||||
__builtins__.exit = HyQuitter('exit')
|
__builtins__.exit = HyQuitter('exit')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(cmdline_handler("hy", sys.argv))
|
sys.exit(cmdline_handler("hy", sys.argv))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user