You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enables reading the request json from STDIN when - is specified as an arg instead of a file path. - is commonly used in CLI tools to indicate reading from STDIN.
For example, pbpaste | lk sip inbound create - to use clipboard contents (on macOS) for creating a SIP trunk.
As I write this I realize pbpaste | lk sip inbound create /dev/stdin is functionally equivalent without code changes, so if that is preferred feel free to close...
disclaimer: mostly generated by codex, with manual review
Summary by CodeRabbit
Release Notes
New Features
Added support for reading input from stdin by using "-" as an argument, providing an alternative to file paths.
Updated help text to document stdin input capability.
Bug Fixes
Added validation to prevent multiple stdin arguments in a single command.
✏️ Tip: You can customize this high-level summary in your review settings.
The changes add stdin support to the request processing logic by treating "-" as a signal to read from standard input. The ReadRequestFileOrLiteral function now checks for "-" before attempting file operations, RequestDesc appends a hint about stdin capability, and createAndPrintReqs validates that "-" is used at most once across multiple arguments.
Changes
Cohort / File(s)
Summary
stdin Support Enhancement cmd/lk/proto.go
Modified ReadRequestFileOrLiteral to read from stdin when "-" is provided; updated RequestDesc with "(or - for stdin)" hint; added validation in createAndPrintReqs to prevent multiple stdin usage when processing multiple arguments.
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
🐰 A dash now opens stdin's door,
No files needed anymore!
Just "-" and watch the data flow,
One stream at once—that's all you need to know! ✨
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
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.
Enables reading the request json from STDIN when
-is specified as an arg instead of a file path.-is commonly used in CLI tools to indicate reading from STDIN.For example,
pbpaste | lk sip inbound create -to use clipboard contents (on macOS) for creating a SIP trunk.As I write this I realize
pbpaste | lk sip inbound create /dev/stdinis functionally equivalent without code changes, so if that is preferred feel free to close...disclaimer: mostly generated by codex, with manual review
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.