mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
allow passing float value to custom command (#12879)
# Description Fixes: #12691 In `parse_short_flag`, it only checks special cases for `SyntaxShape::Int`, `SyntaxShape::Number` to allow a flag to be a number. This pr adds `SyntaxShape::Float` to allow a flag to be float number. # User-Facing Changes This is possible after this pr: ```nushell def spam [val: float] { $val }; spam -1.4 ``` # Tests + Formatting Added 1 test
This commit is contained in:
@ -486,7 +486,7 @@ fn parse_short_flags(
|
||||
&& matches!(
|
||||
sig.get_positional(positional_idx),
|
||||
Some(PositionalArg {
|
||||
shape: SyntaxShape::Int | SyntaxShape::Number,
|
||||
shape: SyntaxShape::Int | SyntaxShape::Number | SyntaxShape::Float,
|
||||
..
|
||||
})
|
||||
)
|
||||
|
Reference in New Issue
Block a user