Skip to content

Commit

Permalink
feat: Add a config subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisjared committed Nov 6, 2024
1 parent 60aa084 commit 0720e01
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/ref/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ dependencies = [
"typer>=0.12.5",
]

[project.scripts]
ref = "ref.cli:app"

[tool.uv]
dev-dependencies = [
]
Expand Down
1 change: 1 addition & 0 deletions packages/ref/src/ref/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
import importlib.metadata

__version__ = importlib.metadata.version("ref")
__core_version__ = importlib.metadata.version("ref_core")
10 changes: 10 additions & 0 deletions packages/ref/src/ref/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Entrypoint for the CLI"""

import typer

from ref.cli import config, sync

app = typer.Typer()

app.command(name="sync")(sync.sync)
app.add_typer(config.app, name="config")
23 changes: 23 additions & 0 deletions packages/ref/src/ref/cli/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
View and update the REF configuration
"""

import typer

app = typer.Typer(help=__doc__)


@app.command()
def list():
"""
Print the current ref configuration
"""
print("config")


@app.command()
def update():
"""
Print the current ref configuration
"""
print("config")
11 changes: 11 additions & 0 deletions packages/ref/src/ref/cli/sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import typer

app = typer.Typer()


@app.command()
def sync():
"""
Placeholder command for syncing data
""" # noqa: D401
print("syncing data")

0 comments on commit 0720e01

Please sign in to comment.