From dac07b711bc6816f90092aa31e1883515807fc51 Mon Sep 17 00:00:00 2001 From: chris-s-friedman Date: Thu, 12 May 2022 10:40:11 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20ability=20to=20query=20any=20?= =?UTF-8?q?http(s)=20dataservice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kf_ds_tools/scripts/ds_copy.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/kf_ds_tools/scripts/ds_copy.py b/kf_ds_tools/scripts/ds_copy.py index af9cf8d..5e64205 100644 --- a/kf_ds_tools/scripts/ds_copy.py +++ b/kf_ds_tools/scripts/ds_copy.py @@ -13,27 +13,32 @@ sequencing_center_handler, ) +api_url_help_text = ( + "Either http url to dataservice or \n" + + f"{[i for i in KF_API_URLS.keys()]}" +) + @click.group() @click.option( "-s", "--source", - type=click.Choice(KF_API_URLS.keys(), case_sensitive=False), + type=str, required=True, - help="Source dataservice to copy FROM", + help="Source dataservice to copy FROM. " + api_url_help_text, ) @click.option( "-t", "--target", - type=click.Choice(KF_API_URLS.keys(), case_sensitive=False), + type=str, required=True, - help="Target dataservice to copy TO", + help="Target dataservice to copy TO. " + api_url_help_text, ) @click.pass_context def copy(ctx, source, target): ctx.ensure_object(dict) - ctx.obj["source"] = KF_API_URLS.get(source) - ctx.obj["target"] = KF_API_URLS.get(target) + ctx.obj["source"] = KF_API_URLS.get(source.lower()) or source + ctx.obj["target"] = KF_API_URLS.get(target.lower()) or target pass