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

Commit

Permalink
Print version with -v or --version in oscapd-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Preisler committed Jan 11, 2016
1 parent ca037e3 commit 9f004d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/oscapd-cli
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,17 @@ def confirm(prompt, default=False):
sys.stderr.write("Operation aborted.\n")
return default


def main():
parser = argparse.ArgumentParser(
description="OpenSCAP-Daemon command line interface."
)
parser.add_argument(
"-v", "--version", action="version",
version="%(prog)s " + version.VERSION_STRING
)
subparsers = parser.add_subparsers()

task_accessor = TaskAccessor()

task_accessor.add_setter("enabled",
Expand Down Expand Up @@ -689,6 +695,10 @@ def main():

args = parser.parse_args()

if args.version:
print("OpenSCAP-daemon CLI %s" % (version.VERSION_STRING))
sys.exit(0)

gobject.threads_init()

dbus_iface = None
Expand Down

0 comments on commit 9f004d3

Please sign in to comment.