Skip to content

Remove --flag: bool support#11541

Merged
WindSoilder merged 6 commits intonushell:mainfrom
WindSoilder:remove_boolean_flag
Jan 25, 2024
Merged

Remove --flag: bool support#11541
WindSoilder merged 6 commits intonushell:mainfrom
WindSoilder:remove_boolean_flag

Conversation

@WindSoilder
Copy link
Copy Markdown
Contributor

@WindSoilder WindSoilder commented Jan 15, 2024

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:   × --flag: bool is not allowed
   ╭─[entry #2:1:1]
 1 │ def foo [--b: bool] {}
   ·               ──┬─
   ·                 ╰── remove this `: bool`, more info: https://www.nushell.sh/book/custom_commands.html#flags
   ╰────

Tests + Formatting

Done

@WindSoilder WindSoilder added the notes:breaking-changes This PR implies a change affecting users and has to be noted in the release notes label Jan 15, 2024
@amtoine amtoine added the category:removal-after-deprecation The component has already been sunset with `deprecation` and is now up for final removal label Jan 16, 2024
Copy link
Copy Markdown
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it's working great 👌

@WindSoilder
Copy link
Copy Markdown
Contributor Author

After discussed internally. It's ok to merge it with new error messages

@WindSoilder WindSoilder merged commit a4809d2 into nushell:main Jan 25, 2024
@hustcer hustcer added this to the v0.90.0 milestone Feb 3, 2024
amtoine added a commit to amtoine/tmux-sessionizer that referenced this pull request Feb 7, 2024
dmatos2012 pushed a commit to dmatos2012/nushell that referenced this pull request Feb 20, 2024
# Description
This is a follow up to: nushell#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 nushell#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 nushell#2:1:1]
 1 │ def foo [--b: bool] {}
   ·               ──┬─
   ·                 ╰── Remove the `: bool` type annotation.
   ╰────
```
# Tests + Formatting
Done
@WindSoilder WindSoilder deleted the remove_boolean_flag branch February 27, 2024 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:removal-after-deprecation The component has already been sunset with `deprecation` and is now up for final removal notes:breaking-changes This PR implies a change affecting users and has to be noted in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants