fix(send): support multiple --to recipients (#41)#43
Merged
c0da-ricon merged 6 commits intoJul 3, 2026
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41
Makes
--toflag variadic (var=#true) so repeated--toflags no longer silently drop earlier recipients. Both--toflag and--filetofield now accept multiple addresses.Changes
.mise/tasks/send— Addedvar=#trueto--todeclaration; addedjson_to_lines()function mirroringjson_cc_lines(); changed scalarTOtoTOSarray 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--toflags,--filearrayto, validation errors, and backward compatibility for single--toand scalar--fileto; removed decorative section-header comments