From 56235e6ae7520dd4a9b370e3ad48e0d76e20f425 Mon Sep 17 00:00:00 2001 From: msweier Date: Mon, 6 Jul 2026 14:42:34 -0500 Subject: [PATCH] feat: allow for line return tsid parsing --- cwmscli/load/timeseries/timeseries.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cwmscli/load/timeseries/timeseries.py b/cwmscli/load/timeseries/timeseries.py index 2c325dd..64326c2 100644 --- a/cwmscli/load/timeseries/timeseries.py +++ b/cwmscli/load/timeseries/timeseries.py @@ -1,3 +1,4 @@ +import re from datetime import datetime, timedelta from typing import Optional @@ -70,7 +71,7 @@ def load_timeseries_ids_all( "ts_id", default=None, type=str, - help="Timeseries ID to copy, or a comma-delimited list of IDs.", + help="Timeseries ID to copy, or a comma/newline-delimited list of IDs.", ) @click.option( "--ts-group", @@ -125,7 +126,7 @@ def load_timeseries_data( ): ts_ids = None if ts_id: - ts_ids = [item.strip() for item in ts_id.split(",") if item.strip()] + ts_ids = [item.strip() for item in re.split(r"[,\r\n]+", ts_id) if item.strip()] if not ts_ids: raise click.UsageError( "--ts-id must contain at least one non-empty timeseries ID."