diff --git a/plugins/tutor-contrib-paragon/README.rst b/plugins/tutor-contrib-paragon/README.rst index a50488a..85e0f23 100644 --- a/plugins/tutor-contrib-paragon/README.rst +++ b/plugins/tutor-contrib-paragon/README.rst @@ -102,36 +102,21 @@ Invoke the build process via Tutor: tutor local do paragon-build-tokens [OPTIONS] -Available options: - -- ``--source-tokens-only`` - Include only source design tokens in the build. - -- ``--output-token-references`` - Include references for tokens with aliases to other tokens in the build output. - -- ``--themes `` - Comma-separated list of theme names to compile. Defaults to the list defined in ``PARAGON_ENABLED_THEMES`` if not provided. - -- ``-v, --verbose`` - Enable verbose logging. +For more information about available options, refer to the `Paragon CLI documentation `__. Examples -------- .. code-block:: bash - # Compile all themes listed in PARAGON_ENABLED_THEMES - tutor local do paragon-build-tokens - - # Compile only specific themes - tutor local do paragon-build-tokens --themes theme-1,theme-2 + # Compile all themes listed in PARAGON_ENABLED_THEMES + tutor local do paragon-build-tokens - # Compile with full debug logs - tutor local do paragon-build-tokens --verbose + # Compile only specific themes + tutor local do paragon-build-tokens --themes theme-1,theme-2 - # Compile only source tokens for a single theme - tutor local do paragon-build-tokens --themes theme-1 --source-tokens-only + # Pass any other Paragon CLI options as needed + tutor local do paragon-build-tokens --paragon-option value Output ------ diff --git a/plugins/tutor-contrib-paragon/tutorparagon/commands.py b/plugins/tutor-contrib-paragon/tutorparagon/commands.py index 7a32264..fccb58d 100644 --- a/plugins/tutor-contrib-paragon/tutorparagon/commands.py +++ b/plugins/tutor-contrib-paragon/tutorparagon/commands.py @@ -9,50 +9,13 @@ import click -@click.command() -@click.option( - "--source-tokens-only", - is_flag=True, - default=False, - help="Include only source design tokens in the build.", +@click.command( + context_settings=dict(ignore_unknown_options=True, allow_extra_args=True) ) -@click.option( - "--output-token-references", - is_flag=True, - default=False, - help="Include references for tokens with aliases to other tokens in the build output.", -) -@click.option("--themes", help="Comma-separated list of themes to build.") -@click.option( - "-v", "--verbose", is_flag=True, default=False, help="Enable verbose logging." -) -def paragon_build_tokens( - source_tokens_only: bool, - output_token_references: bool, - themes: str, - verbose: bool, -) -> list[tuple[str, str]]: +@click.pass_context +def paragon_build_tokens(ctx: click.Context) -> list[tuple[str, str]]: """ Build theme token files using Paragon. - - Args: - source_tokens_only (bool): Only source design tokens. - output_token_references (bool): Output token references. - themes (str): Comma-separated list of themes. - verbose (bool): Verbose logging. - - Returns: - list[tuple[str, str]]: List of commands to run. + Accepts and forwards all options/arguments to paragon-builder. """ - args = [] - if source_tokens_only: - args.append("--source-tokens-only") - if output_token_references: - args.append("--output-token-references") - if themes: - args.append("--themes") - args.append(themes) - if verbose: - args.append("--verbose") - - return [("paragon-builder", " ".join(args))] + return [("paragon-builder", " ".join(ctx.args))]