diff --git a/README.md b/README.md index d1f7029..54b7e33 100644 --- a/README.md +++ b/README.md @@ -25,16 +25,18 @@ In that case the recommended usage is to simply call the script in a subprocess The full help message: ``` > find_libpython --help -usage: find_libpython [-h] [--verbose] [--list-all | --candidate-names | --candidate-paths] +usage: find_libpython [-h] [-v] [--list-all | --candidate-names | --candidate-paths | --platform-info | --version] Locate libpython associated with this Python executable. -optional arguments: +options: -h, --help show this help message and exit - --verbose, -v Print debugging information. + -v, --verbose Print debugging information. --list-all Print list of all paths found. --candidate-names Print list of candidate names of libpython. --candidate-paths Print list of candidate paths of libpython. + --platform-info Print information about the platform and exit. + --version show program's version number and exit ``` Usage as a library might occur when you need to obtain the path to the library in a Python-based build system like distutils. diff --git a/src/find_libpython/__init__.py b/src/find_libpython/__init__.py index c724a07..8969911 100644 --- a/src/find_libpython/__init__.py +++ b/src/find_libpython/__init__.py @@ -426,11 +426,7 @@ def main(args=None): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( - "--verbose", "-v", action="store_true", help="Print debugging information." - ) - - parser.add_argument( - "--version", action="version", version=f"find_libpython {__version__}" + "-v", "--verbose", action="store_true", help="Print debugging information." ) group = parser.add_mutually_exclusive_group() @@ -462,6 +458,9 @@ def main(args=None): const="platform-info", help="Print information about the platform and exit.", ) + group.add_argument( + "--version", action="version", version=f"find_libpython {__version__}" + ) ns = parser.parse_args(args) parser.exit(_cli_find_libpython(**vars(ns)))