diff options
author | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2014-07-25 23:33:57 +0200 |
---|---|---|
committer | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2014-07-25 23:33:57 +0200 |
commit | 4fcb3f4f7fc4b54787491c6e0513cc08e9dc9350 (patch) | |
tree | 0cdb1453f272097bb8cd47846cb2a58ecf5f4479 /sphinx/apidoc.py | |
parent | 269421bc5844ec6234b8c37bfb2a5dcbec609f27 (diff) | |
download | sphinx-git-4fcb3f4f7fc4b54787491c6e0513cc08e9dc9350.tar.gz |
`sphinx-apidoc` command now have a `--version` option to show version information and exit. closes #1518
Diffstat (limited to 'sphinx/apidoc.py')
-rw-r--r-- | sphinx/apidoc.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index 6c423185c..755ea5efe 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -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.') |