replace argparse.Namespace plumbing with typed command inputs

This commit is contained in:
Matteo Rosati
2026-04-22 16:03:51 +02:00
parent 8ebab832d5
commit 2962a2e088
15 changed files with 560 additions and 115 deletions
+4 -3
View File
@@ -1,9 +1,10 @@
from argparse import Namespace
from __future__ import annotations
from chromy.command_inputs import QueryInput
from chromy.utilities import format_query_result, print_lines, run_query
def handle_query(args: Namespace) -> int:
result = run_query(args.collection, args.query_text)
def handle_query(command: QueryInput) -> int:
result = run_query(command.collection, command.query_text)
print_lines(format_query_result(result))
return 0