nushell/crates/nu-protocol/src/engine
WindSoilder 5d98a727ca
Deprecate --flag: bool in custom command (#11365)
# Description
While #11057 is merged, it's hard to tell the difference between
`--flag: bool` and `--flag`, and it makes user hard to read custom
commands' signature, and hard to use them correctly.

After discussion, I think we can deprecate `--flag: bool` usage, and
encourage using `--flag` instead.

# User-Facing Changes
The following code will raise warning message, but don't stop from
running.
```nushell
❯ def florb [--dry-run: bool, --another-flag] { "aaa" };  florb
Error:   × Deprecated: --flag: bool
   ╭─[entry #7:1:1]
 1 │ def florb [--dry-run: bool, --another-flag] { "aaa" };  florb
   ·                       ──┬─
   ·                         ╰── `--flag: bool` is deprecated. Please use `--flag` instead, more info: https://www.nushell.sh/book/custom_commands.html
   ╰────

aaa
```

cc @kubouch 

# Tests + Formatting
Done

# After Submitting
- [ ] Add more information under
https://www.nushell.sh/book/custom_commands.html to indicate `--dry-run:
bool` is not allowed,
- [ ] remove `: bool` from custom commands between 0.89 and 0.90

---------

Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com>
2023-12-21 10:07:08 +01:00
..
call_info.rs Back to working state 2021-09-03 06:21:37 +12:00
capture_block.rs Use Vec for Closure captures (#10940) 2023-11-08 00:43:28 +01:00
command.rs Invert &Options to Option<&T> (#10315) 2023-09-13 07:00:58 +08:00
engine_state.rs Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
mod.rs Split up nu-protocol/src/engine/engine_state.rs (#10368) 2023-09-21 22:53:36 +02:00
overlay.rs Use slices directly instead of &Vec (#10328) 2023-09-12 11:38:20 +08:00
pattern_match.rs Support pattern matching null literals (#10829) 2023-10-25 06:30:45 +08:00
stack.rs Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
state_delta.rs Split up nu-protocol/src/engine/engine_state.rs (#10368) 2023-09-21 22:53:36 +02:00
state_working_set.rs Deprecate --flag: bool in custom command (#11365) 2023-12-21 10:07:08 +01:00
usage.rs Split up nu-protocol/src/engine/engine_state.rs (#10368) 2023-09-21 22:53:36 +02:00