Commit 9c2c0f48 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Add version to CLI

parent 26187ca1
Pipeline #24480 passed with stage
in 49 seconds
......@@ -49,7 +49,7 @@ ValidateConfig = {
ReconstructConfig = {
"input_file": {
"help": "Nabu input file",
"mandatory": True,
"default": "",
},
"log_file": {
"help": "Log file. Default is nabu.log",
......@@ -72,5 +72,10 @@ ReconstructConfig = {
"help": "Beam energy in keV. DEPRECATED, was used to patch missing fields in BCU HDF5 file.",
"default": -1,
"type": float,
}
},
"version": {
"help": "Print the current Nabu version and exit",
"action": "store_const",
"const": "print_version",
},
}
......@@ -6,6 +6,7 @@ from .cli_configs import ReconstructConfig
from ...resources.processconfig import ProcessConfig
from ...app.process import WorkerProcess
from ...app.logger import Logger
from ... import version
def get_subregion(slices_indices, radio_nz):
......@@ -33,6 +34,14 @@ def main():
parser_description="Perform a tomographic reconstruction."
)
do_bootstrap = bool(args["version"])
if do_bootstrap:
print("Nabu %s" % version)
exit(0)
if len(args["input_file"]) == 0:
print("Please provide an input file. Type nabu --help for more information")
exit(0)
proc = ProcessConfig(args["input_file"])
logger = Logger(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment