diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 478853f4e6..65b78f9c9b 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -721,11 +721,9 @@ fn print_available_tasks( )?; if let Some(description) = &desc.task.description { let slash_slash = colors::italic_gray("//"); - writeln!( - writer, - " {slash_slash} {}", - colors::italic_gray(description) - )?; + for line in description.split('\n') { + writeln!(writer, " {slash_slash} {}", colors::italic_gray(line))?; + } } writeln!(writer, " {}", desc.task.command)?; if !desc.task.dependencies.is_empty() { diff --git a/tests/specs/task/description/deno.json b/tests/specs/task/description/deno.json index a86b7a5dcb..c8a79c00ee 100644 --- a/tests/specs/task/description/deno.json +++ b/tests/specs/task/description/deno.json @@ -3,6 +3,10 @@ "echo_emoji": { "description": "This is some task", "command": "echo 1" + }, + "multiline_description": { + "description": "This is a multiline\ndescription", + "command": "echo 2" } } } diff --git a/tests/specs/task/description/main.out b/tests/specs/task/description/main.out index ed28506567..91cce4adf8 100644 --- a/tests/specs/task/description/main.out +++ b/tests/specs/task/description/main.out @@ -2,3 +2,7 @@ Available tasks: - echo_emoji // This is some task echo 1 +- multiline_description + // This is a multiline + // description + echo 2