replace argparse.Namespace plumbing with typed command inputs
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
from argparse import Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from chromy.chroma_functions import count_collection
|
||||
from chromy.command_inputs import CountCollectionInput
|
||||
|
||||
|
||||
def handle_count_collection(args: Namespace) -> int:
|
||||
print(count_collection(args.collection))
|
||||
def handle_count_collection(command: CountCollectionInput) -> int:
|
||||
print(count_collection(command.collection))
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user