Skip to content

Commit

Permalink
cli
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Oct 16, 2024
1 parent 0d228f8 commit 6ea7ecb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 4 additions & 3 deletions openlch/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@


@click.group()
def cli():
def cli() -> None:
"""OpenLCH CLI tool for interacting with MilkV boards."""
pass
raise NotImplementedError("The CLI is not yet implemented")


@cli.command()
@click.option("--ip", required=True, help="IP address of the MilkV board")
def ping(ip):
def ping(ip: str) -> None:
"""Ping the MilkV board at the specified IP address."""
try:
result = subprocess.run(["ping", "-c", "4", ip], capture_output=True, text=True, check=False)
Expand All @@ -28,4 +28,5 @@ def ping(ip):


if __name__ == "__main__":
# python -m openlch.cli
cli()
4 changes: 4 additions & 0 deletions openlch/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# requirements.txt

# For communicating with the board.
websockets
pydantic

# For the CLI.
click
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@
tests_require=requirements_dev,
extras_require={"dev": requirements_dev},
packages=["openlch"],
entry_points={
"console_scripts": [
"openlch=openlch.cli:cli",
],
},
)

0 comments on commit 6ea7ecb

Please sign in to comment.