From f0f460641d0683c6aa67a665115ad58f3a0b9ddd Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Mon, 26 Jan 2026 05:50:38 -0600 Subject: [PATCH 1/2] One-line error messages from the compiler front end need new-line When the gren compiler front end reports a simple one line error message for "I don't recognize this command", it fails to terminate the output with a newline character. This change adds a new helper function, endErrorWithLine, which uses Stream.Log.line, to avoid changing other existing usages of endErrorWithString. --- src/Main.gren | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Main.gren b/src/Main.gren index 4929c402..a00e65e9 100644 --- a/src/Main.gren +++ b/src/Main.gren @@ -342,6 +342,10 @@ parseUserArgs model compilerPath = |> Stream.Log.string model.stderr |> Task.map (\_ -> Task.execute <| Node.exitWithCode 1) + endWithErrorLine stringErr = + Stream.Log.line model.stderr stringErr + |> Task.map (\_ -> Task.execute <| Node.exitWithCode 1) + endWithErrorString stringErr = Stream.Log.string model.stderr stringErr |> Task.map (\_ -> Task.execute <| Node.exitWithCode 1) @@ -352,7 +356,7 @@ parseUserArgs model compilerPath = in when CLI.Parser.run model.args CliParser.parser is CLI.Parser.UnknownCommand commandName -> - endWithErrorString ("I don't recognize this command: " ++ commandName) + endWithErrorLine ("I don't recognize this command: " ++ commandName) |> Task.perform RunCmd CLI.Parser.BadFlags err -> From 99991a217c773b4468ae7d9c70b6fbea3665015e Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Mon, 26 Jan 2026 06:57:30 -0600 Subject: [PATCH 2/2] Remove newly-added endWithErrorLine and just append "\n" Keep it simple --- src/Main.gren | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Main.gren b/src/Main.gren index a00e65e9..9bda445b 100644 --- a/src/Main.gren +++ b/src/Main.gren @@ -342,10 +342,6 @@ parseUserArgs model compilerPath = |> Stream.Log.string model.stderr |> Task.map (\_ -> Task.execute <| Node.exitWithCode 1) - endWithErrorLine stringErr = - Stream.Log.line model.stderr stringErr - |> Task.map (\_ -> Task.execute <| Node.exitWithCode 1) - endWithErrorString stringErr = Stream.Log.string model.stderr stringErr |> Task.map (\_ -> Task.execute <| Node.exitWithCode 1) @@ -356,7 +352,7 @@ parseUserArgs model compilerPath = in when CLI.Parser.run model.args CliParser.parser is CLI.Parser.UnknownCommand commandName -> - endWithErrorLine ("I don't recognize this command: " ++ commandName) + endWithErrorString ("I don't recognize this command: " ++ commandName ++ "\n") |> Task.perform RunCmd CLI.Parser.BadFlags err ->