Skip to content

Commit 7dafee9

Browse files
benthorneravaldebe
authored andcommitted
Add __main__ CLI hook to support local dev
This follows the convention for typer prorams. Note the same can also be achieved with e.g. python -c 'from pms.cli import main; main()' but having it run automatically saves documenting this.
1 parent ecd0c9d commit 7dafee9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pms/cli.py

+4
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,7 @@ def csv(
131131
csv.write("time,sensor,hex\n")
132132
for raw in reader(raw=True):
133133
csv.write(f"{raw.time},{sensor_name},{raw.hex}\n")
134+
135+
136+
if __name__ == "__main__": # pragma: no cover
137+
main()

0 commit comments

Comments
 (0)