From 670426539e4aa228f3898a23382d4cf4fcf33830 Mon Sep 17 00:00:00 2001 From: Richard Maynard <112959480+rmaynardap@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:47:15 -0500 Subject: [PATCH] use csv for splitting instead of whitespace (#35) --- tfworker/cli.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tfworker/cli.py b/tfworker/cli.py index 23baca5..3cb37b2 100644 --- a/tfworker/cli.py +++ b/tfworker/cli.py @@ -88,6 +88,13 @@ def validate_working_dir(fpath): click.secho(f"Working path {fpath} must be empty!", fg="red") raise SystemExit(1) +class CSVType(click.types.StringParamType): + name = 'csv' + envvar_list_splitter = ',' + + def __repr__(self): + return 'CSV' + @click.group() @click.option( @@ -234,6 +241,7 @@ def cli(context, **kwargs): help="limit operations to a single definition", envvar="WORKER_LIMIT", multiple=True, + type=CSVType(), ) @click.argument("deployment", callback=validate_deployment) @click.pass_obj @@ -320,6 +328,7 @@ def version(): help="limit operations to a single definition", envvar="WORKER_LIMIT", multiple=True, + type=CSVType(), ) @click.option( "--provider-cache",