From e3a5f3072ead65f3882d729c0727497a41d46412 Mon Sep 17 00:00:00 2001 From: Villu Ruusmann Date: Fri, 13 Dec 2024 20:35:22 +0200 Subject: [PATCH] Added '--version' command-line option --- jpmml_evaluator/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jpmml_evaluator/cli.py b/jpmml_evaluator/cli.py index ad07fa0..c9d568d 100644 --- a/jpmml_evaluator/cli.py +++ b/jpmml_evaluator/cli.py @@ -4,9 +4,11 @@ import pandas -from jpmml_evaluator import make_evaluator +from jpmml_evaluator import __version__, make_evaluator def main(): + version = "JPMML-Evaluator-Python {}".format(__version__) + parser = ArgumentParser(prog = "jpmml_evaluator", description = "JPMML-Evaluator command-line application") parser.add_argument("model", type = str, help = "Model PMML file") parser.add_argument("--backend", type = str, default = "jpype", help = "Java backend. One of 'jpype', 'pyjnius' or 'py4j'") @@ -14,6 +16,7 @@ def main(): parser.add_argument("-i", "--input", type = str, help = "Input CSV file. If absent, read from system input") parser.add_argument("-o", "--output", type = str, help = "Output CSV file. If absent, write to system output") parser.add_argument("--sep", type = str, default = ",", help = "CSV separator character") + parser.add_argument("--version", action = "version", version = version) args = parser.parse_args()