Compare commits
	
		
			3 Commits
		
	
	
		
			16-watchli
			...
			5c73d55d91
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						5c73d55d91
	
				 | 
					
					
						|||
| 
						
						
							
						
						9e70fc25d4
	
				 | 
					
					
						|||
| 
						
						
							
						
						63ee619aef
	
				 | 
					
					
						
@@ -25,6 +25,7 @@ Options:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Commands:
 | 
					Commands:
 | 
				
			||||||
  pr         Get merge status of pull request.
 | 
					  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.
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,12 +65,14 @@ def since(
 | 
				
			|||||||
        return
 | 
					        return
 | 
				
			||||||
    typer.echo(count)
 | 
					    typer.echo(count)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@watchlist_app.command()
 | 
					@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."""
 | 
					    """List PRs in watchlist."""
 | 
				
			||||||
    wl = Watchlist.from_file()
 | 
					    wl = Watchlist.from_file()
 | 
				
			||||||
    wl.print(format=format)
 | 
					    wl.print(format=format)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@watchlist_app.command()
 | 
					@watchlist_app.command()
 | 
				
			||||||
def add(pr: int):
 | 
					def add(pr: int):
 | 
				
			||||||
    """Add PR to watchlist."""
 | 
					    """Add PR to watchlist."""
 | 
				
			||||||
@@ -80,6 +82,7 @@ def add(pr: int):
 | 
				
			|||||||
    info = wl.pr(pr)
 | 
					    info = wl.pr(pr)
 | 
				
			||||||
    print(f"Added #{info.pr}: {info.title} to watchlist.")
 | 
					    print(f"Added #{info.pr}: {info.title} to watchlist.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@watchlist_app.command()
 | 
					@watchlist_app.command()
 | 
				
			||||||
def remove(pr: int):
 | 
					def remove(pr: int):
 | 
				
			||||||
    """Remove PR from watchlist."""
 | 
					    """Remove PR from watchlist."""
 | 
				
			||||||
@@ -88,6 +91,7 @@ def remove(pr: int):
 | 
				
			|||||||
    wl.to_file()
 | 
					    wl.to_file()
 | 
				
			||||||
    print(f"Removed #{pr} from watchlist.")
 | 
					    print(f"Removed #{pr} from watchlist.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def main():
 | 
					def main():
 | 
				
			||||||
    app()
 | 
					    app()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,7 @@ from rich.console import Console
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
from nixprstatus.pr import get_pr
 | 
					from nixprstatus.pr import get_pr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class OutputFormat(str, Enum):
 | 
					class OutputFormat(str, Enum):
 | 
				
			||||||
    CONSOLE = "console"
 | 
					    CONSOLE = "console"
 | 
				
			||||||
    JSON = "json"
 | 
					    JSON = "json"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user