mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 22:57:46 +00:00
replace occurences of str collect
with str join
(#436)
This commit is contained in:
parent
2cc5b58209
commit
b7a45fbcca
29 changed files with 117 additions and 117 deletions
|
@ -5,7 +5,7 @@ def gen_keywords [] {
|
|||
and category !~ deprecated
|
||||
and ($it.command | str contains -n ' ')
|
||||
| get command
|
||||
| str collect '|')
|
||||
| str join '|')
|
||||
|
||||
let var_with_dash_or_under_regex = '(([a-zA-Z]+[\\-_]){1,}[a-zA-Z]+\\s)'
|
||||
let preamble = '\\b('
|
||||
|
@ -30,7 +30,7 @@ def gen_sub_keywords [] {
|
|||
let cmds = (for x in $sub_cmds {
|
||||
let parts = ($x | split row ' ')
|
||||
$'($parts.0)\\s($parts.1)'
|
||||
} | str collect '|')
|
||||
} | str join '|')
|
||||
$'"match": "($preamble)($cmds)($postamble)",'
|
||||
}
|
||||
$"Generating sub keywords(char nl)"
|
||||
|
@ -57,11 +57,11 @@ def gen_keywords_alphabetically [] {
|
|||
} else {
|
||||
$nothing
|
||||
}
|
||||
} | str collect '|')
|
||||
} | str join '|')
|
||||
if ($letter_cmds | str trim | str length) > 0 {
|
||||
$'"match": "($preamble)($letter_cmds)($postamble)",'
|
||||
}
|
||||
} | str collect "\n"
|
||||
} | str join "\n"
|
||||
}
|
||||
|
||||
"Generating keywords alphabetically\n"
|
||||
|
@ -89,11 +89,11 @@ def gen_sub_keywords_alphabetically [] {
|
|||
} else {
|
||||
$nothing
|
||||
}
|
||||
} | str collect '|')
|
||||
} | str join '|')
|
||||
if ($letter_cmds | str trim | str length) > 0 {
|
||||
$'"match": "($preamble)($letter_cmds)($postamble)",'
|
||||
}
|
||||
} | str collect "\n"
|
||||
} | str join "\n"
|
||||
}
|
||||
|
||||
"Generating sub keywords alphabetically\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue