diff --git a/AUTHORS b/AUTHORS index b987a9b..6ae7875 100644 --- a/AUTHORS +++ b/AUTHORS @@ -93,3 +93,4 @@ * Andrew R. M. * Tristan de Cacqueray * Sören Tempel +* Noah Snelson diff --git a/hy/cmdline.py b/hy/cmdline.py index 4c0c1fa..02b0609 100644 --- a/hy/cmdline.py +++ b/hy/cmdline.py @@ -59,9 +59,19 @@ class HyQuitter(object): pass raise SystemExit(code) +class HyHelper(object): + def __repr__(self): + return ("Use (help) for interactive help, or (help object) for help " + "about object.") + + def __call__(self, *args, **kwds): + import pydoc + return pydoc.help(*args, **kwds) + builtins.quit = HyQuitter('quit') builtins.exit = HyQuitter('exit') +builtins.help = HyHelper() @contextmanager def extend_linecache(add_cmdline_cache):