From 578b57694fdb06ce22e2b14dd4d79110d93b35cb Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Sun, 6 Dec 2020 20:36:58 +0100 Subject: [PATCH] propka3 --version prints version Closes https://github.com/jensengroup/propka/issues/89 --- docs/source/command.rst | 5 ++--- propka/lib.py | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/command.rst b/docs/source/command.rst index e135bac..86476b9 100644 --- a/docs/source/command.rst +++ b/docs/source/command.rst @@ -62,10 +62,9 @@ protein-ligand complexes based in the 3D structure. The specifying mutation labels which is used to modify according to, e.g. N25R/N181D (default: None) -.. option:: -v VERSION_LABEL, --version VERSION_LABEL +.. option:: --version - specifying the sub-version of propka [Jan15/Dec19] - (default: Jan15) + show program's version number and exit .. option:: -p PARAMETERS, --parameters PARAMETERS diff --git a/propka/lib.py b/propka/lib.py index 5409851..5a3d204 100644 --- a/propka/lib.py +++ b/propka/lib.py @@ -198,6 +198,8 @@ def build_parser(parser=None): Argument `--generate-propka-input` has been removed as writing PROPKA input files is no longer supported. """ + import propka + if parser is not None: group = parser.add_argument_group(title="PROPKA invocation options") else: @@ -241,8 +243,7 @@ def build_parser(parser=None): help=("specifying mutation labels which is used to modify " " according to, e.g. N25R/N181D")) group.add_argument( - "-v", "--version", dest="version_label", default="Jan15", - help="specifying the sub-version of propka [Jan15/Dec19]") + "--version", action="version", version=f"%(prog)s {propka.__version__}") group.add_argument( "-p", "--parameters", dest="parameters", default=pkg_resources.resource_filename(__name__, "propka.cfg"),