mirror of
https://github.com/junegunn/fzf.git
synced 2026-07-12 03:20:50 +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:
committed by
Junegunn Choi
parent
6765f464a6
commit
24832e97ef
+2
-1
@@ -116,7 +116,8 @@ def __fzf_list_hosts [] {
|
||||
(
|
||||
# Process ssh config files
|
||||
$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
|
||||
| default { hosts: null } # Handle lines that don't match regex
|
||||
| get hosts
|
||||
|
||||
Reference in New Issue
Block a user