EU Parliament Monitor — API Documentation - v0.8.49
    Preparing search index...

    Function parseCliArgsSafe

    • Pure, non-exiting CLI parser. Returns a discriminated union representing each possible outcome:

      • {kind:'help'}--help or -h was passed; print HELP_TEXT and exit 0.
      • {kind:'error', message} — argv was rejected (unknown flag, missing value, invalid language, run dir not found, etc.); print message to stderr and exit non-zero.
      • {kind:'options', value} — argv parsed cleanly; value is ready to pass to generateArticle / generateAllArticles.

      Compared to the legacy parseCliArgs in article-generator.ts (which throws and calls process.exit on --help), this entry point keeps tests self-contained.

      Parameters

      • argv: readonly string[]

        Raw argv (without the node / script path prefix)

      • repoRoot: string

        Absolute repo root used to resolve relative --run

      Returns ParsedCli

      Discriminated parse result