Skip to content

Commit

Permalink
Add __main__ CLI hook to support local dev
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
benthorner authored and avaldebe committed Nov 19, 2021
1 parent ecd0c9d commit 7dafee9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pms/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,7 @@ def csv(
csv.write("time,sensor,hex\n")
for raw in reader(raw=True):
csv.write(f"{raw.time},{sensor_name},{raw.hex}\n")


if __name__ == "__main__": # pragma: no cover
main()

0 comments on commit 7dafee9

Please sign in to comment.