Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 9f004d3

Browse files
author
Martin Preisler
committed
Print version with -v or --version in oscapd-cli
1 parent ca037e3 commit 9f004d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bin/oscapd-cli

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,17 @@ def confirm(prompt, default=False):
513513
sys.stderr.write("Operation aborted.\n")
514514
return default
515515

516+
516517
def main():
517518
parser = argparse.ArgumentParser(
518519
description="OpenSCAP-Daemon command line interface."
519520
)
521+
parser.add_argument(
522+
"-v", "--version", action="version",
523+
version="%(prog)s " + version.VERSION_STRING
524+
)
520525
subparsers = parser.add_subparsers()
526+
521527
task_accessor = TaskAccessor()
522528

523529
task_accessor.add_setter("enabled",
@@ -689,6 +695,10 @@ def main():
689695

690696
args = parser.parse_args()
691697

698+
if args.version:
699+
print("OpenSCAP-daemon CLI %s" % (version.VERSION_STRING))
700+
sys.exit(0)
701+
692702
gobject.threads_init()
693703

694704
dbus_iface = None

0 commit comments

Comments
 (0)