Make `-h` option outputs version number
Closed this issue · 4 comments
A fast/easy way to check the turboSETI version installed
Believe it or not, this issue is not simple. Not impossible but might involve structure changes to the package.
Even though a user can do this with the installed package:
from turbo_seti import __version__ as TS_VERSION
the resident code (E.g. seti_event.py, the main code for turboSETI) cannot because it would creste a circular reference. I've tried.
Ohh goodie... Not sure if it's a good practice, but can the -h
execute the following:
import os
os.system("python -c \"from turbo_seti import __version__ as TS_VERSION; print(TS_VERSION)\"")
Or even better:
import os,sys
os.system("%s -c \"from turbo_seti import __version__ as TS_VERSION; print(TS_VERSION)\"" %sys.executable)
This way it uses the same executable that turboSETI
is using
@texadactyl. Also, on second thought, it's probably better to make this -v
--version
flags, rather than making it print the version number with -h
--help
. This would make it a nicer way to log things, by just calling turboSETI -v
at a high level