mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-04 15:08:36 +08:00
nushell: fix 0.114.0 nushell str downcase deprecated error
We switch to `str lowercase` and add a note for the Nushell<0.114.0 user that should display at runtime. Close #4857
This commit is contained in:
+2
-1
@@ -116,7 +116,8 @@ def __fzf_list_hosts [] {
|
|||||||
(
|
(
|
||||||
# Process ssh config files
|
# Process ssh config files
|
||||||
$ssh_configs | append $ssh_configs_d | append $ssh_config_global
|
$ssh_configs | append $ssh_configs_d | append $ssh_config_global
|
||||||
| where {|it| ($it | str downcase | str starts-with 'host') or ($it | str downcase | str starts-with 'hostname') }
|
# NOTE: str lowercase is new from Nushell 0.114.0. Please upgrade to Nushell >=0.114.0 if you are seeing `extra positional argument` error regarding `str lowercase` in this block.
|
||||||
|
| where {|it| ($it | str lowercase | str starts-with 'host') or ($it | str lowercase | str starts-with 'hostname') }
|
||||||
| parse --regex '^\s*host(?:name)?\s+(?<hosts>.+)' # Extract hosts after keyword
|
| parse --regex '^\s*host(?:name)?\s+(?<hosts>.+)' # Extract hosts after keyword
|
||||||
| default { hosts: null } # Handle lines that don't match regex
|
| default { hosts: null } # Handle lines that don't match regex
|
||||||
| get hosts
|
| get hosts
|
||||||
|
|||||||
Reference in New Issue
Block a user