diff -r 019045db2bec -r a148416e7e7d src/eric7/eric7_api.py --- a/src/eric7/eric7_api.py Wed Nov 08 17:26:08 2023 +0100 +++ b/src/eric7/eric7_api.py Wed Nov 08 17:52:21 2023 +0100 @@ -38,12 +38,11 @@ " plugin." ), 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.", ) @@ -67,9 +66,6 @@ " repeated multiple times.", ) parser.add_argument( - "-h", "--help", action="store_true", help="Show this help and exit." - ) - parser.add_argument( "-i", "--ignore", action="store_true", @@ -90,6 +86,7 @@ default="", help="Write the API information to the named file. A '%%L'" # noqa: M601 " placeholder is replaced by the language of the API file (see --language).", + required=True, ) parser.add_argument( "-p", @@ -115,7 +112,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( @@ -130,25 +128,6 @@ return parser -def version(): - """ - Function to show the version information. - """ - print( - """eric7_api {0}\n""" - """\n""" - """eric API generator.\n""" - """\n""" - """Copyright (c) 2004 - 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) - ) - - def main(): """ Main entry point into the application. @@ -158,22 +137,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." - ) - - if not args.output: - parser.error("No output file given.") - excludeDirs = [ ".svn", ".hg",