Skip to content

feat(ltx): add -level flag to view LTX files at any compaction level#1072

Merged
corylanou merged 2 commits intomainfrom
issue-1050-ltx-level-flag
Feb 5, 2026
Merged

feat(ltx): add -level flag to view LTX files at any compaction level#1072
corylanou merged 2 commits intomainfrom
issue-1050-ltx-level-flag

Conversation

@corylanou
Copy link
Collaborator

Summary

  • Add -level flag to the ltx CLI command to view LTX files at any compaction level (0-9) or all levels at once
  • Add levelVar custom flag type with validation (matches existing txidVar pattern)
  • When -level all is used, output includes a level column; single-level output remains backward compatible
  • Add table-driven tests for levelVar parsing and string conversion

Closes #1050

Test plan

  • go build -o bin/litestream ./cmd/litestream succeeds
  • go test -v ./cmd/litestream/ -run TestLevelVar passes
  • ./bin/litestream ltx -h shows new -level flag documentation
  • pre-commit run --all-files passes

🤖 Generated with Claude Code

Add `-level` flag to the `ltx` CLI command so users can view LTX files
at any compaction level (0-9) or all levels at once with `-level all`.

The `ReplicaClient.LTXFiles()` method already accepts a level parameter
across all backends - this exposes it via the CLI.

Closes #1050

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Simplify code by removing separate code paths for single level vs all
levels display. The level column is now always shown regardless of
whether -level flag is set.

Addresses review feedback from @benbjohnson.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@corylanou corylanou merged commit e0370ba into main Feb 5, 2026
19 checks passed
@corylanou corylanou deleted the issue-1050-ltx-level-flag branch February 5, 2026 18:49
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.

feat(ltx): add -level flag to view snapshots and other compaction levels

2 participants