replace argparse.Namespace plumbing with typed command inputs
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
from argparse import Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from chromy.command_inputs import ListCollectionsInput
|
||||
from chromy.chroma_functions import list_collections
|
||||
from chromy.utilities import print_lines
|
||||
|
||||
|
||||
def handle_list_collections(_: Namespace) -> int:
|
||||
def handle_list_collections(_: ListCollectionsInput) -> int:
|
||||
collections = list_collections()
|
||||
if not collections:
|
||||
print("No collections found.")
|
||||
|
||||
Reference in New Issue
Block a user