mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 07:07:46 +00:00
replace filter
with where
(#1135)
This PR tries to clean up the use of `filter` by replacing it with `where`. I did not test each script. closes #1134 closes #1133
This commit is contained in:
parent
84c25bbc6d
commit
32cdc96414
25 changed files with 66 additions and 66 deletions
|
@ -34,7 +34,7 @@ def "nu-complete mask args" [context: string, offset: int] {
|
|||
$rt ++= ($c | get named_flags | each {|x|
|
||||
let v = if not ($x.long | is-empty) { $"`--($x.long)`" } else if not ($x.short | is-empty) { $"`-($x.short)`" } else { $"---($x.name)" }
|
||||
let a = ["required", "multiple", "takes_value", "validate_as_number"]
|
||||
| filter {|y| ($x | get $y) == true }
|
||||
| where {|y| ($x | get $y) == true }
|
||||
| str join ','
|
||||
let d = if ($a | is-empty) { $x.description } else { $"($x.description) \(($a))" }
|
||||
{value: $v , description: $d }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue