From 93b72febbed57e682806884c76dcbd82fca20640 Mon Sep 17 00:00:00 2001 From: Villu Ruusmann Date: Sat, 14 Dec 2024 11:07:02 +0200 Subject: [PATCH] Added '--version' command-line option --- sklearn2pmml/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sklearn2pmml/cli.py b/sklearn2pmml/cli.py index 8aa9b84..7a205c1 100644 --- a/sklearn2pmml/cli.py +++ b/sklearn2pmml/cli.py @@ -1,13 +1,16 @@ from argparse import ArgumentParser -from sklearn2pmml import sklearn2pmml +from sklearn2pmml import __version__, sklearn2pmml import joblib def main(): + version = "SkLearn2PMML {}".format(__version__) + parser = ArgumentParser(prog = "sklearn2pmml", description = "SkLearn2PMML command-line application") parser.add_argument("-i", "--input", type = str, required = True, help = "Input Pickle file") parser.add_argument("-o", "--output", type = str, required = True, help = "Output PMML file") parser.add_argument("--schema", type = str, help = "Output PMML schema version") + parser.add_argument("--version", action = "version", version = version) args = parser.parse_args()