forked from mttu-developers/konabot
fix: remove redundant whitespace check; echo no-arg outputs empty line
This commit is contained in:
@ -189,7 +189,7 @@ class PipelineRunner:
|
|||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if c.isspace() or c in " ":
|
if c.isspace():
|
||||||
flush_word()
|
flush_word()
|
||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
|
|||||||
@ -14,8 +14,7 @@ class THEcho(TextHandler):
|
|||||||
self, env: TextHandlerEnvironment, istream: str | None, args: list[str]
|
self, env: TextHandlerEnvironment, istream: str | None, args: list[str]
|
||||||
) -> TextHandleResult:
|
) -> TextHandleResult:
|
||||||
# echo 不读 stdin,只输出参数(Unix 语义)
|
# echo 不读 stdin,只输出参数(Unix 语义)
|
||||||
if len(args) == 0:
|
# 无参数时输出空行(与 Unix echo 行为一致)
|
||||||
return TextHandleResult(1, "请在 echo 后面添加需要输出的文本")
|
|
||||||
return TextHandleResult(0, "\n".join(args))
|
return TextHandleResult(0, "\n".join(args))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user