Context
#1655 (gmail insert) added src/cli/gmail/selection.rs — a Selection/SelectionArgs pair filtering manifest.jsonl by --all/--since/--until/--id/--ids-from/--source-label. It was built as a shared module specifically so gmail render --archive-dir could adopt it later, per its own doc comment:
Factored out as its own module (rather than inlined into insert.rs) so render can adopt it later — a follow-up, not part of this change.
Problem
gmail render --archive-dir DIR --all (src/cli/gmail/render.rs) currently has exactly one selector: --all, over every non-deleted manifest record. There's no way to render only messages in a date range, or a specific set of ids, without first filtering them into a directory of .eml paths some other way.
Proposal
Replace render's --archive-dir --all pair with #[command(flatten)] selection: SelectionArgs (or a subset of it), reusing Selection::from_args/Selection::matches against manifest.records_not_deleted() the same way gmail insert's engine does. --all should keep working identically (it's already one of Selection's selectors) — this is additive, not a breaking change to the existing invocation.
Non-goals
- No change to
render's bare-file-paths mode (omni-dev gmail render *.eml), which has no --archive-dir involvement at all.
Ref #1655.
Context
#1655 (
gmail insert) addedsrc/cli/gmail/selection.rs— aSelection/SelectionArgspair filteringmanifest.jsonlby--all/--since/--until/--id/--ids-from/--source-label. It was built as a shared module specifically sogmail render --archive-dircould adopt it later, per its own doc comment:Problem
gmail render --archive-dir DIR --all(src/cli/gmail/render.rs) currently has exactly one selector:--all, over every non-deleted manifest record. There's no way to render only messages in a date range, or a specific set of ids, without first filtering them into a directory of.emlpaths some other way.Proposal
Replace
render's--archive-dir --allpair with#[command(flatten)] selection: SelectionArgs(or a subset of it), reusingSelection::from_args/Selection::matchesagainstmanifest.records_not_deleted()the same waygmail insert's engine does.--allshould keep working identically (it's already one ofSelection's selectors) — this is additive, not a breaking change to the existing invocation.Non-goals
render's bare-file-paths mode (omni-dev gmail render *.eml), which has no--archive-dirinvolvement at all.Ref #1655.