1
Fork 0
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:
Darren Schroeder 2023-04-03 08:47:25 -05:00 committed by GitHub
parent 2cc5b58209
commit b7a45fbcca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 117 additions and 117 deletions

View file

@ -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"