mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 03:17:58 +02:00
Remove --flag: bool
support (#11541)
# Description This is a follow up to: #11365 After this pr, `--flag: bool` is no longer allowed. I think `ParseWarning::Deprecated` is useful when we want to deprecated something at syntax level, so I just leave it there for now. # User-Facing Changes ## Before ``` ❯ def foo [--b: bool] {} Error: × Deprecated: --flag: bool ╭─[entry #15:1:1] 1 │ def foo [--b: bool] {} · ──┬─ · ╰── `--flag: bool` is deprecated and will be removed in 0.90. Please use `--flag` instead, more info: https://www.nushell.sh/book/custom_commands.html ╰──── ``` ## After ``` ❯ def foo [--b: bool] {} Error: × Type annotations are not allowed for boolean switches. ╭─[entry #2:1:1] 1 │ def foo [--b: bool] {} · ──┬─ · ╰── Remove the `: bool` type annotation. ╰──── ``` # Tests + Formatting Done
This commit is contained in:
@ -149,8 +149,7 @@ fn custom_flag2() -> TestResult {
|
||||
#[test]
|
||||
fn deprecated_boolean_flag() {
|
||||
let actual = nu!(r#"def florb [--dry-run: bool, --another-flag] { "aaa" }; florb"#);
|
||||
assert!(actual.err.contains("Deprecated"));
|
||||
assert_eq!(actual.out, "aaa");
|
||||
assert!(actual.err.contains("not allowed"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user