sphinx-apidoc command now have a --version option to show version information and exit. closes #1518

This commit is contained in:
Takayuki Shimizukawa 2014-07-25 23:33:57 +02:00
parent 269421bc58
commit 4fcb3f4f7f
2 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,12 @@
Release 1.2.3 (in development)
==============================
Features added
--------------
* #1518: `sphinx-apidoc` command now have a `--version` option to show version
information and exit
Bugs fixed
----------

View File

@ -20,6 +20,7 @@ import optparse
from os import path
from sphinx.util.osutil import walk
from sphinx import __version__
# automodule options
if 'SPHINX_APIDOC_OPTIONS' in os.environ:
@ -300,9 +301,15 @@ Note: By default this script will not overwrite already created files.""")
parser.add_option('-R', '--doc-release', action='store', dest='release',
help='Project release, used when --full is given, '
'defaults to --doc-version')
parser.add_option('--version', action='store_true', dest='show_version',
help='Show version information and exit')
(opts, args) = parser.parse_args(argv[1:])
if opts.show_version:
print 'Sphinx (sphinx-apidoc) %s' % __version__
return 0
if not args:
parser.error('A package path is required.')