From cca5e85b7fb0382c48a3359dc757c1aab01812c8 Mon Sep 17 00:00:00 2001 From: WindSoilder Date: Wed, 17 Jul 2024 15:06:07 +0800 Subject: [PATCH] add warn message for break and continue --- crates/nu-cmd-lang/src/core_commands/break_.rs | 4 +++- crates/nu-cmd-lang/src/core_commands/continue_.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/nu-cmd-lang/src/core_commands/break_.rs b/crates/nu-cmd-lang/src/core_commands/break_.rs index 90cc1a73f2..7636acdcb5 100644 --- a/crates/nu-cmd-lang/src/core_commands/break_.rs +++ b/crates/nu-cmd-lang/src/core_commands/break_.rs @@ -21,7 +21,9 @@ impl Command for Break { fn extra_usage(&self) -> &str { r#"This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html"# + https://www.nushell.sh/book/thinking_in_nu.html + + WARN: Don't try to use it in closure. Although it will raise error, statements before `break` will be executed"# } fn command_type(&self) -> CommandType { diff --git a/crates/nu-cmd-lang/src/core_commands/continue_.rs b/crates/nu-cmd-lang/src/core_commands/continue_.rs index cfa3e38335..0edc704166 100644 --- a/crates/nu-cmd-lang/src/core_commands/continue_.rs +++ b/crates/nu-cmd-lang/src/core_commands/continue_.rs @@ -21,7 +21,9 @@ impl Command for Continue { fn extra_usage(&self) -> &str { r#"This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html"# + https://www.nushell.sh/book/thinking_in_nu.html + + WARN: Don't try to use it in closure. Although it will raise error, statements before `continue` will be executed"# } fn command_type(&self) -> CommandType {