src/eric7/eric7_doc.py

branch
eric7
changeset 10298
a148416e7e7d
parent 10296
2d3218cb56dc
child 10303
ee1aadab1215
diff -r 019045db2bec -r a148416e7e7d src/eric7/eric7_doc.py
--- a/src/eric7/eric7_doc.py	Wed Nov 08 17:26:08 2023 +0100
+++ b/src/eric7/eric7_doc.py	Wed Nov 08 17:52:21 2023 +0100
@@ -42,12 +42,11 @@
     parser = argparse.ArgumentParser(
         description="Create source code documentation files.",
         epilog="Copyright (c) 2004 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>.",
-        add_help=False,
     )
 
     parser.add_argument(
         "file",
-        nargs="*",
+        nargs="+",
         help="'file' can be either python modules, package directories or ordinary"
         " directories. At least one 'file' argument must be given.",
     )
@@ -76,12 +75,6 @@
         " repeated multiple times.",
     )
     parser.add_argument(
-        "-h",
-        "--help",
-        action="store_true",
-        help="Show this help and exit.",
-    )
-    parser.add_argument(
         "-i",
         "--no-index",
         action="store_true",
@@ -117,7 +110,8 @@
     parser.add_argument(
         "-V",
         "--version",
-        action="store_true",
+        action="version",
+        version="%(prog)s {0}".format(Version),
         help="Show version information and exit.",
     )
     parser.add_argument(
@@ -227,26 +221,6 @@
     return parser
 
 
-def version():
-    """
-    Function to show the version information.
-    """
-    print(
-        """eric7_doc  {0}\n"""
-        """\n"""
-        """eric API documentation generator.\n"""
-        """\n"""
-        """Copyright (c) 2003-2023 Detlev Offenbach"""
-        """ <detlev@die-offenbachs.de>\n"""
-        """This is free software; see LICENSE.txt for copying"""
-        """ conditions.\n"""
-        """There is NO warranty; not even for MERCHANTABILITY or FITNESS"""
-        """ FOR A\n"""
-        """PARTICULAR PURPOSE.""".format(Version)
-    )
-    sys.exit(1)
-
-
 def main():
     """
     Main entry point into the application.
@@ -254,19 +228,6 @@
     parser = createArgumentParser()
     args = parser.parse_args()
 
-    if args.help:
-        parser.print_help()
-        sys.exit(1)
-    elif args.version:
-        version()
-        sys.exit(1)
-
-    if not args.file:
-        parser.error(
-            "At least one file, Python module, Python package or directory must be"
-            " given."
-        )
-
     excludeDirs = [
         ".svn",
         ".hg",

eric ide

mercurial