Coverage for harbor_cli/commands/api/search.py: 78%

9 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-02-09 12:09 +0100

1from __future__ import annotations 

2 

3import typer 

4 

5from ...app import app 

6from ...output.render import render_result 

7from ...state import state 

8 

9 

10@app.command() 

11def search( 

12 ctx: typer.Context, 

13 query: str = typer.Argument(..., help="The search query."), 

14) -> None: 

15 """Search for projects, repositories and charts.""" 

16 results = state.run(state.client.search(query), "Searching...") 

17 render_result(results, ctx)