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

Commit

Permalink
Simplified version printing code in oscapd
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Preisler committed Jan 11, 2016
1 parent a602fe5 commit ca037e3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions bin/oscapd
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,15 @@ def main():
parser = argparse.ArgumentParser(
description="OpenSCAP-Daemon executable."
)
parser.add_argument("-v", "--version",
help="show version",
action="store_true")
parser.add_argument(
"-v", "--version", action="version",
version="%(prog)s " + version.VERSION_STRING
)
parser.add_argument("--verbose",
help="be verbose, useful for debugging",
action="store_true")
args = parser.parse_args()

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

logging.basicConfig(format='%(levelname)s:%(message)s',
level=logging.DEBUG if args.verbose else logging.INFO)
logging.info("OpenSCAP Daemon %s", version.VERSION_STRING)
Expand Down

0 comments on commit ca037e3

Please sign in to comment.