Skip to content

fix custom command's default value#11043

Merged
sholderbach merged 5 commits intonushell:mainfrom
WindSoilder:switch_with_default_arg
Nov 14, 2023
Merged

fix custom command's default value#11043
sholderbach merged 5 commits intonushell:mainfrom
WindSoilder:switch_with_default_arg

Conversation

@WindSoilder
Copy link
Copy Markdown
Contributor

@WindSoilder WindSoilder commented Nov 13, 2023

Description

Fixes: #11033

Sorry for the issue, it's a regression which introduce by this pr: #10456.
And this pr is going to fix it.

About the change: create a new field named type_annotated for Arg::Flag and Arg::Signature instead of arg_explicit_type variable.
When we meet a type in TypeMode, we set type_annotated field of the argument to be true, then we know that if the arg have a annotated type easily

@WindSoilder WindSoilder marked this pull request as draft November 13, 2023 09:34
@WindSoilder WindSoilder marked this pull request as ready for review November 13, 2023 09:58
@WindSoilder WindSoilder marked this pull request as draft November 13, 2023 14:54
@WindSoilder WindSoilder marked this pull request as ready for review November 14, 2023 00:11
Copy link
Copy Markdown
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

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

With the caveat that the whole parse_signature_helper is an absolute monster that I can not really reason about by "just looking at it".
The diff looks good to me and the added and old tests pass, so I think we are good to go.

@sholderbach sholderbach merged commit 942ff7d into nushell:main Nov 14, 2023
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
# Description
Fixes: nushell#11033

Sorry for the issue, it's a regression which introduce by this pr:
nushell#10456.
And this pr is going to fix it.

About the change: create a new field named `type_annotated` for
`Arg::Flag` and `Arg::Signature` instead of `arg_explicit_type`
variable.
When we meet a type in `TypeMode`, we set `type_annotated` field of the
argument to be true, then we know that if the arg have a annotated type
easily
dmatos2012 pushed a commit to dmatos2012/nushell that referenced this pull request Feb 20, 2024
# Description
Fixes: nushell#11033

Sorry for the issue, it's a regression which introduce by this pr:
nushell#10456.
And this pr is going to fix it.

About the change: create a new field named `type_annotated` for
`Arg::Flag` and `Arg::Signature` instead of `arg_explicit_type`
variable.
When we meet a type in `TypeMode`, we set `type_annotated` field of the
argument to be true, then we know that if the arg have a annotated type
easily
@WindSoilder WindSoilder deleted the switch_with_default_arg 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nushell 0.86 regression: command option type and value is incorrectly inferred from default value

2 participants