Docs: fix README to use strings(), document separator behavior#310
Merged
iCharlesHu merged 1 commit intoJun 11, 2026
Merged
Conversation
The README used execution.standardOutput.lines() in several examples, but the API is strings(separatedBy:bufferingPolicy:[as:]) — lines() does not exist, so those snippets did not compile. Align them with the shipping API (including the parameterized form: encoding is passed via 'as:'). Also clarify on strings() that the separator characters are not included in the returned strings, matching the StringSequence type documentation. Refs swiftlang#286. (Leaves the strings()->lines() rename proposal to the maintainers.)
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.
Refs #286.
README: several examples used
execution.standardOutput.lines(), but the API isstrings(separatedBy:bufferingPolicy:)/strings(separatedBy:bufferingPolicy:as:)— there is nolines(), so those snippets don't compile. This aligns them with the shipping API, including the parameterized form where the encoding is passed viaas:(notencoding:):Doc comment:
strings()didn't state whether the separator is kept. Added a note that the separator characters are not included in the returned strings, matching the existingStringSequencetype documentation.Docs-only change. I've intentionally left the
strings()→lines()rename proposed in #286 to the maintainers — happy to follow up with that if you'd like to go that way (in which case the README would move the other direction).