3 Commits

Author SHA1 Message Date
5c73d55d91 Run ruff format
All checks were successful
test / test (push) Successful in 34s
build / build (push) Successful in 2m2s
2024-10-09 22:29:14 +02:00
9e70fc25d4 Update README
Some checks failed
test / test (push) Successful in 33s
build / build (push) Has been cancelled
2024-10-09 22:27:27 +02:00
63ee619aef Merge branch '16-watchlist'
Some checks failed
test / test (push) Successful in 33s
build / build (push) Has been cancelled
2024-10-09 22:25:48 +02:00
4 changed files with 12 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ Options:
Commands:
pr Get merge status of pull request.
since Return the count of commits that has happened between the two refs.
since Return the count of commits that has happened between the...
watchlist Manage watchlist.
```

View File

@@ -65,12 +65,14 @@ def since(
return
typer.echo(count)
@watchlist_app.command()
def list(watchlist: str|None = None, format: OutputFormat = OutputFormat.CONSOLE):
def list(watchlist: str | None = None, format: OutputFormat = OutputFormat.CONSOLE):
"""List PRs in watchlist."""
wl = Watchlist.from_file()
wl.print(format=format)
@watchlist_app.command()
def add(pr: int):
"""Add PR to watchlist."""
@@ -80,6 +82,7 @@ def add(pr: int):
info = wl.pr(pr)
print(f"Added #{info.pr}: {info.title} to watchlist.")
@watchlist_app.command()
def remove(pr: int):
"""Remove PR from watchlist."""
@@ -88,6 +91,7 @@ def remove(pr: int):
wl.to_file()
print(f"Removed #{pr} from watchlist.")
def main():
app()

View File

@@ -7,6 +7,7 @@ from rich.console import Console
from nixprstatus.pr import get_pr
class OutputFormat(str, Enum):
CONSOLE = "console"
JSON = "json"