summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sphinx/apidoc.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py
index 10311e6f3..805e862c9 100644
--- a/sphinx/apidoc.py
+++ b/sphinx/apidoc.py
@@ -373,3 +373,7 @@ Note: By default this script will not overwrite already created files.""")
qs.generate(d, silent=True, overwrite=opts.force)
elif not opts.notoc:
create_modules_toc_file(modules, opts)
+
+# So program can be started with "python -m sphinx.apidoc ..."
+if __name__ == "__main__":
+ main()