Extend entry search filtering

This commit is contained in:
thePR0M3TH3AN committed 2025-07-18 14:54:10 -04:00
1 parent 5eab7f879c
commit b0ba723bdd
10 files changed
+90 -86

No files matched your search

+13 -3
View File
@@ -1,5 +1,5 @@
from pathlib import Path
from typing import Optional
from typing import Optional, List
import json
import typer
@@ -135,10 +135,20 @@ def entry_list(
@entry_app.command("search")
def entry_search(ctx: typer.Context, query: str) -> None:
def entry_search(
ctx: typer.Context,
query: str,
kind: List[str] = typer.Option(
None,
"--kind",
"-k",
help="Filter by entry kinds (can be repeated)",
),
) -> None:
"""Search entries."""
service = _get_entry_service(ctx)
results = service.search_entries(query)
kinds = list(kind) if kind else None
results = service.search_entries(query, kinds=kinds)
if not results:
typer.echo("No matching entries found")
return