mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
throw parser error when multiple short flags are defined without whitespace (#6000)
* throw error when multiple short flags are defined without whitespace * add tests
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use nu_test_support::nu;
|
||||
use nu_test_support::playground::Playground;
|
||||
use nu_test_support::{nu, pipeline};
|
||||
use std::fs;
|
||||
|
||||
#[test]
|
||||
@ -18,3 +18,15 @@ def e [arg] {echo $arg}
|
||||
assert!(actual.out.contains("My echo\\n\\n"));
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn def_errors_with_multiple_short_flags() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
def test-command [ --long(-l)(-o) ] {}
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.err.contains("expected one short flag"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user