mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
feat: Allow combining -p and stdin for prompt input (#4406)
Co-authored-by: Allen Hutchison <adh@google.com>
This commit is contained in:
@@ -297,8 +297,11 @@ export async function main() {
|
||||
}
|
||||
// If not a TTY, read from stdin
|
||||
// This is for cases where the user pipes input directly into the command
|
||||
if (!process.stdin.isTTY && !input) {
|
||||
input += await readStdin();
|
||||
if (!process.stdin.isTTY) {
|
||||
const stdinData = await readStdin();
|
||||
if (stdinData) {
|
||||
input = `${stdinData}\n\n${input}`;
|
||||
}
|
||||
}
|
||||
if (!input) {
|
||||
console.error('No input provided via stdin.');
|
||||
|
||||
Reference in New Issue
Block a user