nexu-io/open-design · error · SystemExit
--search requires at least one source.
Error message
--search requires at least one source.
What it means
parse_search_flag() raises SystemExit('--search requires at least one source.') when, after splitting/lowering/stripping/filtering empty tokens, the resulting sources list is empty. This catches `--search ''`, `--search ','`, and `--search ' '` — the flag was provided but yielded no usable source. It fires after the unknown-source check, so all surviving tokens were valid but there were zero of them.
Source
Thrown at design-templates/last30days/scripts/last30days.py:85
continue
atexit.register(_cleanup_children)
def parse_search_flag(raw: str) -> list[str]:
sources = []
for source in raw.split(","):
source = source.strip().lower()
if not source:
continue
normalized = pipeline.SEARCH_ALIAS.get(source, source)
if normalized not in pipeline.MOCK_AVAILABLE_SOURCES:
raise SystemExit(f"Unknown search source: {source}")
if normalized not in sources:
sources.append(normalized)
if not sources:
raise SystemExit("--search requires at least one source.")
return sources
def slugify(value: str) -> str:
slug = re.sub(r"[^a-z0-9]+", "-", value.lower()).strip("-")
return slug or "last30days"
def save_output(
report: schema.Report,
emit: str,
save_dir: str,
suffix: str = "",
synthesis_md: str | None = None,
) -> Path:
from datetime import datetime
path = Path(save_dir).expanduser().resolve()
path.mkdir(parents=True, exist_ok=True)View on GitHub (pinned to 5be4028344)
Solutions
- Either omit `--search` entirely (defaults to all available sources), or
- Supply at least one valid source: `--search reddit`.
- If driven by a shell variable, default it: `--search "${LIST:-reddit}"`.
Example fix
# before
python3.12 last30days.py --topic x --search "$LIST" # LIST unset -> ''
# after
python3.12 last30days.py --topic x --search "${LIST:-reddit}" Defensive patterns
Strategy: validation
Validate before calling
tokens = [t.strip().lower() for t in raw.split(',') if t.strip()]
if not tokens:
raise ValueError('--search needs at least one source (or omit the flag)') Prevention
- Default unset list variables in shell: `${LIST:-reddit}`.
- Omit --search entirely when you want all sources.
When it happens
Trigger: `--search ""`, `--search ,,,`, or `--search " "` passed on the command line. The empty-string branch (`if not source: continue`) skips every token, leaving `sources == []`, which trips the final guard.
Common situations: Shell-quoting accident that passes an empty value; a script templating `--search $LIST` with LIST unset; a user who thought the flag was boolean and supplied an empty string.
Related errors
- Unknown search source: {source}
- Unsupported emit mode: {emit}
- [last30days] Cannot read --synthesis-file: {exc}
- [CompetitorsPlan] Cannot read plan file: {exc}
- [CompetitorsPlan] Invalid JSON: {exc}
AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12).
Data as JSON: /api/errors/8769db4768cef85b.
Report an issue: GitHub.