Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
Adding an option to display the version and quit
Browse files Browse the repository at this point in the history
change v to V to be coherent with setup.py
  • Loading branch information
TGLuis committed May 26, 2020
1 parent d20a0c0 commit 36e426c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cuckoo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def handle_sigterm(sig, f):
stop()

@click.group(invoke_without_command=True)
@click.option("-V", "--version", is_flag=True, help="Display the version of Cuckoo")
@click.option("-d", "--debug", is_flag=True, help="Enable verbose logging")
@click.option("-q", "--quiet", is_flag=True, help="Only log warnings and critical messages")
@click.option("--nolog", is_flag=True, help="Don't log to file.")
Expand All @@ -256,7 +257,7 @@ def handle_sigterm(sig, f):
@click.option("--user", help="Drop privileges to this user")
@click.option("--cwd", help="Cuckoo Working Directory")
@click.pass_context
def main(ctx, debug, quiet, nolog, maxcount, ignore_vuln, user, cwd):
def main(ctx, version, debug, quiet, nolog, maxcount, ignore_vuln, user, cwd):
"""Invoke the Cuckoo daemon or one of its subcommands.
To be able to use different Cuckoo configurations on the same machine with
Expand All @@ -271,6 +272,10 @@ def main(ctx, debug, quiet, nolog, maxcount, ignore_vuln, user, cwd):
* Current directory (if the ".cwd" file exists)
* Default value ("~/.cuckoo")
"""
if version:
print(cuckoo.misc.version)
return

decide_cwd(cwd)

# Drop privileges.
Expand Down

0 comments on commit 36e426c

Please sign in to comment.