Skip to content

gmail render: adopt the shared Selection filter from gmail insert #1656

Description

@newhoggy

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions