File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515)
1616
1717
18+ @app .callback (invoke_without_command = True )
19+ def version_check (
20+ version : bool = typer .Option (
21+ False ,
22+ "-V" ,
23+ "--version" ,
24+ help = "Check the current version of wristpy and exist." ,
25+ is_eager = True ,
26+ ),
27+ ) -> None :
28+ """Print current version of wristpy and exit."""
29+ if version :
30+ typer .echo (f"Wristpy version: { config .get_version ()} " )
31+ raise typer .Exit ()
32+
33+
1834class OutputFileType (str , Enum ):
1935 """Valid output file types for saving data."""
2036
@@ -54,13 +70,6 @@ class NonwearAlgorithms(str, Enum):
5470 detach = "detach"
5571
5672
57- def version_callback (version : bool ):
58- """Check the version independently."""
59- if version :
60- typer .echo (f"Wristpy version: { config .get_version ()} " )
61- raise typer .Exit ()
62-
63-
6473@app .command ()
6574def main (
6675 input : pathlib .Path = typer .Argument (
@@ -129,15 +138,6 @@ def main(
129138 help = "Determines the level of verbosity. Use -v for info, -vv for debug. "
130139 "If -vvv or more, it will be set to debug. "
131140 "Default for warning." ,
132- callback = version_callback ,
133- ),
134- version : bool = typer .Option (
135- False ,
136- "-V" ,
137- "--version" ,
138- help = "Show the version and exit." ,
139- callback = version_callback ,
140- is_eager = True ,
141141 ),
142142) -> None :
143143 """Run wristpy orchestrator with command line arguments."""
You can’t perform that action at this time.
0 commit comments