summaryrefslogtreecommitdiff
path: root/sphinx/quickstart.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-03 21:04:57 +0100
committerGeorg Brandl <georg@python.org>2010-12-03 21:04:57 +0100
commitec85695e7cf90ece1d121998c2c0194d049b8301 (patch)
tree4c4336c94315c7a9e3fa419ef14317cdf71cf247 /sphinx/quickstart.py
parent537db42eced3c8fd359a5154172fe1e90301b860 (diff)
downloadsphinx-git-ec85695e7cf90ece1d121998c2c0194d049b8301.tar.gz
Allow giving root dir to quickstart as an argument.
Diffstat (limited to 'sphinx/quickstart.py')
-rw-r--r--sphinx/quickstart.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index b67ee054c..d79c555d3 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -784,14 +784,24 @@ def inner_main(args):
if not color_terminal():
nocolor()
+ if len(args) > 3:
+ print 'Usage: sphinx-quickstart [root]'
+ sys.exit(1)
+ elif len(args) == 2:
+ d['path'] = args[1]
+
print bold('Welcome to the Sphinx %s quickstart utility.') % __version__
print '''
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).'''
- print '''
+ if 'path' in d:
+ print bold('''
+Selected root path: %s''' % d['path'])
+ else:
+ print '''
Enter the root path for documentation.'''
- do_prompt(d, 'path', 'Root path for the documentation', '.', is_path)
+ do_prompt(d, 'path', 'Root path for the documentation', '.', is_path)
while path.isfile(path.join(d['path'], 'conf.py')) or \
path.isfile(path.join(d['path'], 'source', 'conf.py')):