Add support for arbitrarily nested subcommands (#3688)

This commit is contained in:
JT
2021-06-26 09:09:06 +12:00
committed by GitHub
parent 6cdd8a2b07
commit b1970f79ee
2 changed files with 42 additions and 14 deletions

View File

@ -1059,6 +1059,30 @@ fn better_subexpr_lex() {
assert_eq!(actual.out, "6");
}
#[test]
fn subsubcommand() {
let actual = nu!(
cwd: ".", pipeline(
r#"
def "aws s3 rb" [url] { $url + " loaded" }; aws s3 rb localhost
"#)
);
assert_eq!(actual.out, "localhost loaded");
}
#[test]
fn manysubcommand() {
let actual = nu!(
cwd: ".", pipeline(
r#"
def "aws s3 rb ax vf qqqq rrrr" [url] { $url + " loaded" }; aws s3 rb ax vf qqqq rrrr localhost
"#)
);
assert_eq!(actual.out, "localhost loaded");
}
mod parse {
use nu_test_support::nu;