From 7a2910f89775a68acf3961151fc85e55da5fb500 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 25 Apr 2023 16:41:24 +0100 Subject: [PATCH] py/cli: add --version option This patch implements the '--version' for the crit tool. $ crit --version 3.17 Signed-off-by: Radostin Stoyanov --- lib/py/cli.py | 1 + test/others/crit/test.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/py/cli.py b/lib/py/cli.py index 594035d27..a3a0870f8 100755 --- a/lib/py/cli.py +++ b/lib/py/cli.py @@ -364,6 +364,7 @@ def main(): desc = 'CRiu Image Tool' parser = argparse.ArgumentParser( description=desc, formatter_class=argparse.RawTextHelpFormatter) + parser.add_argument('--version', action='version', version=pycriu.__version__) subparsers = parser.add_subparsers( help='Use crit CMD --help for command-specific help') diff --git a/test/others/crit/test.sh b/test/others/crit/test.sh index 105aac72b..2698bbd3c 100755 --- a/test/others/crit/test.sh +++ b/test/others/crit/test.sh @@ -101,6 +101,8 @@ function run_test2 { ${CRIT} x ./ rss || exit 1 } +${CRIT} --version + gen_imgs run_test1 run_test2