-
Notifications
You must be signed in to change notification settings - Fork 2.1k
options are broken? #10450
Copy link
Copy link
Closed
Labels
A:parserIssues related to parsingIssues related to parsing
Milestone
Description
related to
- don't overrite arg's type if it's annotated explicitly #10424
- Make it possible to pass boolean flags dynamically #7260
Describe the bug
@WindSoilder
i think #10424 did break Nushell options 😢
How to reproduce
- define
def foo [--option: bool = false] { $option }before
> foo
false> foo --option
Error: nu::parser::missing_flag_param
× Missing flag argument.
╭─[entry #8:1:1]
1 │ foo --option
· ────┬───
· ╰── flag missing bool argument
╰────> foo --option true
trueafter
> foo
false> foo --option
false> foo --option false
Error: nu::parser::extra_positional
× Extra positional argument.
╭─[entry #4:1:1]
1 │ foo --option false
· ──┬──
· ╰── extra positional argument
╰────
help: Usage: foo {flags}Expected behavior
i think i expected
foo --optionto give true and
foo --option falseto not give an error
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.85.1 |
| branch | |
| commit_hash | 989a147 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.70.0 (90c541806 2023-05-31) |
| rust_channel | 1.70.0-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.70.0 (ec8a8a0ca 2023-04-25) |
| build_time | 2023-09-20 22:42:11 +02:00 |
| build_rust_channel | release |
| allocator | mimalloc |
| features | default, sqlite, trash, which, zip |
| installed_plugins | gstat, nu_plugin_explore |
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:parserIssues related to parsingIssues related to parsing