Skip to content

refactor!: make in2lambda a command group (convert) - #24

Open
m-messer wants to merge 3 commits into
markdown-filterfrom
cli-group
Open

m-messer wants to merge 3 commits into
markdown-filterfrom
cli-group

Conversation

@m-messer

@m-messer m-messer commented Sep 1, 2026

Copy link
Copy Markdown
Member

BREAKING CHANGE: file conversion moves from in2lambda <file> <filter> to in2lambda convert <file> <filter>.

cli is now a click.group so further subcommands (a wizard, etc.) can be added without overloading the top-level command. The former command body is unchanged, just relocated to convert; runner() is untouched.

  • pyproject [tool.poetry.scripts] and command-line.rst still point at in2lambda.main:cli — sphinx-click renders the subcommand automatically.
  • quickstart examples updated to in2lambda convert ... with a note.
  • tests/test_cli.py added (CliRunner): help, output files, case-insensitive filter names, unknown-filter rejection.

Stack: markdown-filter ← cli-group ← llm-client ← …
Base: markdown-filter#23.

🤖 Generated with Claude Code

BREAKING CHANGE: file conversion moves from `in2lambda <file> <filter>` to
`in2lambda convert <file> <filter>`.

`cli` is now a click.group so further subcommands (a wizard, etc.) can be
added without overloading the top-level command. The former command body is
unchanged, just relocated to `convert`; `runner()` is untouched.

- pyproject `[tool.poetry.scripts]` and docs/source/reference/command-line.rst
  still point at `in2lambda.main:cli` - no change needed there, sphinx-click
  renders the subcommand automatically.
- quickstart examples updated to `in2lambda convert ...` with a note.
- tests/test_cli.py added (CliRunner) covering help, output files,
  case-insensitive filter names, and unknown-filter rejection.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017VXb8aZqgFBjoeuuddjW6r
@peterbjohnson

Copy link
Copy Markdown
Member

One thing to sort out before this merges: the old command form doesn't fail, it quietly does nothing.

Running against this branch with the locked click 8.1.7:

in2lambda convert <file> PartsSepSol     exit 0   (converts, as expected)
in2lambda /abs/path/example.tex PartsSepSol   exit 0   prints usage, converts nothing
in2lambda ./example.tex PartsSepSol           exit 0   prints usage, converts nothing
in2lambda example.tex PartsSepSol             exit 2   usage error

So anyone passing an absolute path, which includes every Docker invocation using /files/... and any script, gets a successful exit code, no output files and no error. A bare relative filename is the only form that fails properly.

Either forward the old form to convert with a deprecation warning, or make it exit non-zero with a message pointing at the new spelling. A test for the absolute-path case would be worth having, since that's the one that behaves worst.

Separately: this is a breaking change to a published CLI, but pyproject.toml still says version = "1.0.0" on every branch in the stack, and there's no changelog in the repo. Worth a major bump and a short migration note in the release, so anyone pinning the old form finds out why it stopped working.

@m-messer

Copy link
Copy Markdown
Member Author

Added error message when command is not found. To my knowledge this isn't used elsewhere so no issues with rejecting the legacy command

@m-messer
m-messer added this pull request to stack #48 September 16, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants