From 798a24eda5aebe395a4489e28c0a30dd0c246043 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Sat, 25 Jan 2020 08:14:49 +1300 Subject: [PATCH] Soften restrictions for external parameters (#1277) * Soften restrictions for external parameters * Add test --- crates/nu-parser/src/parse/parser.rs | 3 +-- tests/shell/pipeline/commands/external.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/nu-parser/src/parse/parser.rs b/crates/nu-parser/src/parse/parser.rs index c2445ca45a..9e4e6e560f 100644 --- a/crates/nu-parser/src/parse/parser.rs +++ b/crates/nu-parser/src/parse/parser.rs @@ -1008,8 +1008,7 @@ fn is_boundary(c: Option) -> bool { fn is_external_word_char(c: char) -> bool { match c { - ';' | '|' | '#' | '-' | '"' | '\'' | '$' | '(' | ')' | '[' | ']' | '{' | '}' | '`' - | '.' => false, + ';' | '|' | '"' | '\'' | '$' | '(' | ')' | '[' | ']' | '{' | '}' | '`' => false, other if other.is_whitespace() => false, _ => true, } diff --git a/tests/shell/pipeline/commands/external.rs b/tests/shell/pipeline/commands/external.rs index f0edd9e352..6949874da8 100644 --- a/tests/shell/pipeline/commands/external.rs +++ b/tests/shell/pipeline/commands/external.rs @@ -78,6 +78,19 @@ mod it_evaluation { } } +mod external_words { + use super::nu; + + #[test] + fn relaxed_external_words() { + let actual = nu!(cwd: ".", r#" + cococo joturner@foo.bar.baz + "#); + + assert_eq!(actual, "joturner@foo.bar.baz"); + } +} + mod tilde_expansion { use super::nu;