Skip to content
Myr

nushell: fix 0.114.0 nushell str downcase deprecated error

Before adoption: this commit came in with the history the project adopted, so no landing records it.

We switch to `str lowercase` and add a note for the Nushell<0.114.0 user that should display at runtime. Close #4857

authored by Simon Désaulniers · committed by Junegunn Choi · parent 6765f46 · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:shell/completion.nu+2 added-1 removed
114 unmodified lines
115 [116 (117 # Process ssh config files118 $ssh_configs | append $ssh_configs_d | append $ssh_config_global119 # 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.119 | where {|it| ($it | str downcase | str starts-with 'host') or ($it | str downcase | str starts-with 'hostname') }120 | where {|it| ($it | str lowercase | str starts-with 'host') or ($it | str lowercase | str starts-with 'hostname') }121 | parse --regex '^\s*host(?:name)?\s+(?<hosts>.+)' # Extract hosts after keyword122 | default { hosts: null } # Handle lines that don't match regex123 | get hosts124 | where {|it| $it != null }
366 unmodified lines