Skip to content

fix(send): support multiple --to recipients (#41)#43

Merged
c0da-ricon merged 6 commits into
KnickKnackLabs:mainfrom
olavostauros:fix/multiple-to-recipients
Jul 3, 2026
Merged

fix(send): support multiple --to recipients (#41)#43
c0da-ricon merged 6 commits into
KnickKnackLabs:mainfrom
olavostauros:fix/multiple-to-recipients

Conversation

@olavostauros

Copy link
Copy Markdown
Contributor

Closes #41

Makes --to flag variadic (var=#true) so repeated --to flags no longer silently drop earlier recipients. Both --to flag and --file to field now accept multiple addresses.

Changes

  • .mise/tasks/send — Added var=#true to --to declaration; added json_to_lines() function mirroring json_cc_lines(); changed scalar TO to TOS array with full linear-overwrite precedence (positional < file < flags); To: header and output summary join multiple recipients with ,
  • test/send.bats — Added 7 regression tests covering multiple --to flags, --file array to, validation errors, and backward compatibility for single --to and scalar --file to; removed decorative section-header comments

olavostauros and others added 6 commits July 2, 2026 17:53
Makes --to flag variadic (var=#true) so repeated --to flags no longer
silently drop earlier recipients. Both --to flag and --file to field
now accept multiple addresses.

- Added var=#true to --to USAGE declaration, matching --cc and --attach
- Added json_to_lines() function, mirroring json_cc_lines(), to parse
  --file to as either a string or array of strings
- Changed scalar TO to TOS array with TO_COUNT tracking
- TO resolution preserves existing precedence: positional < file < flags
- To: header and output summary join multiple recipients with ', '
- Added 7 regression tests: multiple --to, --file array to, validations,
  and backward compat for single --to and scalar --file to
- Removed decorative section-header comments from test file

Refs KnickKnackLabs#41
Moves --to flag processing behind _TO_FLAGS temp array instead of
an if-guard, matching the ricon-family pattern used by --cc and
--attach. The guard if [ -n "${usage_to:-}" ] could fire when
mise initializes usage_to to a non-empty value (e.g., newline)
from the var=#true default="" declaration, causing positional
and --file TO values to be silently dropped.

Refs KnickKnackLabs#41
Seven new regression tests for the multiple --to recipients fix
increased the test suite total.

Refs KnickKnackLabs#41
The badge, inline count, and unit test breakdown all needed updating
for the 7 new regression tests in test/send.bats.

Refs KnickKnackLabs#41
@c0da-ricon
c0da-ricon merged commit 00ccfb0 into KnickKnackLabs:main Jul 3, 2026
2 checks passed
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.

emails send drops earlier repeated --to recipients

2 participants