From 44bfa767a6a3dc0a5e1ffd8b162ece7257d551b0 Mon Sep 17 00:00:00 2001 From: James Turk Date: Sun, 7 May 2023 23:07:47 -0500 Subject: [PATCH] allow passing input --- src/beakers/cli.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/beakers/cli.py b/src/beakers/cli.py index 94ab3f4..b503f91 100644 --- a/src/beakers/cli.py +++ b/src/beakers/cli.py @@ -1,6 +1,7 @@ import importlib import typer import sys +from typing import List, Optional from typing_extensions import Annotated app = typer.Typer() @@ -26,8 +27,14 @@ def show(recipe: Annotated[str, typer.Option(...)]): @app.command() -def run(recipe: Annotated[str, typer.Option(...)]): +def run( + recipe: Annotated[str, typer.Option(...)], + input: Annotated[Optional[List[str]], typer.Option(...)] = None, +): mod = _load_recipe(recipe) + for input_str in input: + beaker, filename = input_str.split("=") + mod.csv_to_beaker(filename, beaker) mod.run_once()