Closed noraj closed 3 years ago
rawsec-cli --version
output:
rawsec-cli, version: 1.0.0, commit: b016aca28c20f6b64d5a4eb84e226fc2a35ed472
Full documentation: https://rawsec-cli.readthedocs.io/
in setup.py when you run python setup.py install i write build commit in a file. I don't know if you have a better idea, if not i will merged and close issue.
try:
commit = subprocess.check_output("git rev-parse --verify HEAD", shell=True)
except subprocess.CalledProcessError as e:
print("Exception on process, rc=", e.returncode, "output=", e.output)
commit = b"commit name not found"
with open("rawsec_cli/__init__.py", "w") as f:
f.write(
f'# autogenerated\n__version__ = "{str(version)}"\n__commit__ = "{str(commit, "utf-8").strip()}"\n',
)
f.close()
Looks good, I don't see another way writing the build id in a file.
ok lets go so.
If it's possible to have
-h
option alias for--help
and also maybe add a-V
and--version
that display the version (1.0.0) and the build commit (eg. 442239e).