diff options
Diffstat (limited to 'sphinx/quickstart.py')
-rw-r--r-- | sphinx/quickstart.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index 390415ee3..26b420d07 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -5,7 +5,7 @@ Quickly setup documentation source to work with Sphinx. - :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function @@ -16,6 +16,16 @@ from io import open TERM_ENCODING = getattr(sys.stdin, 'encoding', None) +#try to import readline, unix specific enhancement +try: + import readline + if 'libedit' in readline.__doc__: + readline.parse_and_bind("bind ^I rl_complete") + else: + readline.parse_and_bind("tab: complete") +except ImportError: + pass + from docutils.utils import column_width from sphinx import __version__ @@ -933,6 +943,7 @@ class ValidationError(Exception): """Raised for validation errors.""" def is_path(x): + x = path.expanduser(x) if path.exists(x) and not path.isdir(x): raise ValidationError("Please enter a valid path name.") return x @@ -1309,3 +1320,7 @@ def main(argv=sys.argv): print('[Interrupted.]') return generate(d) + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) |