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
+5 -4
View File
@@ -1,9 +1,10 @@
from argparse import Namespace
from __future__ import annotations
from chromy.command_inputs import AddDataInput
from chromy.utilities import ingest_file
def handle_add_data(args: Namespace) -> int:
records_added = ingest_file(args.collection, args.file)
print(f"Added {records_added} records to collection '{args.collection}'.")
def handle_add_data(command: AddDataInput) -> int:
records_added = ingest_file(command.collection, command.file)
print(f"Added {records_added} records to collection '{command.collection}'.")
return 0