From f32dc6bcd85ea25b5e057a6ccac48ada7bf74187 Mon Sep 17 00:00:00 2001 From: Zuruh Date: Mon, 12 Feb 2024 22:31:04 +0100 Subject: [PATCH] Update nushell template to use rest operator where needed (#663) --- CHANGELOG.md | 2 +- README.md | 2 +- man/man1/zoxide-init.1 | 2 +- templates/nushell.txt | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f6ad00..99e18ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Nushell: support for v0.86.0. +- Nushell: support for v0.89.0. ## [0.9.2] - 2023-08-04 diff --git a/README.md b/README.md index aaf2bf6..7763589 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ zoxide can be installed in 4 easy steps: > ``` > > **Note** - > zoxide only supports Nushell v0.86.0+. + > zoxide only supports Nushell v0.89.0+. diff --git a/man/man1/zoxide-init.1 b/man/man1/zoxide-init.1 index cd53ee9..387c318 100644 --- a/man/man1/zoxide-init.1 +++ b/man/man1/zoxide-init.1 @@ -45,7 +45,7 @@ Now, add this to the \fBend\fR of your config file (find it by running \fBsource ~/.zoxide.nu\fR .fi .sp -Note: zoxide only supports Nushell v0.86.0+. +Note: zoxide only supports Nushell v0.89.0+. .TP .B powershell Add this to the \fBend\fR of your config file (find it by running \fBecho diff --git a/templates/nushell.txt b/templates/nushell.txt index 2cfdb00..d5a193a 100644 --- a/templates/nushell.txt +++ b/templates/nushell.txt @@ -44,7 +44,7 @@ def --env __zoxide_z [...rest:string] { let path = if (($rest | length) <= 1) and ($arg0 == '-' or ($arg0 | path expand | path type) == dir) { $arg0 } else { - (zoxide query --exclude $env.PWD -- $rest | str trim -r -c "\n") + (zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n") } cd $path {%- if echo %} @@ -54,7 +54,7 @@ def --env __zoxide_z [...rest:string] { # Jump to a directory using interactive search. def --env __zoxide_zi [...rest:string] { - cd $'(zoxide query --interactive -- $rest | str trim -r -c "\n")' + cd $'(zoxide query --interactive -- ...$rest | str trim -r -c "\n")' {%- if echo %} echo $env.PWD {%- endif %} @@ -86,4 +86,4 @@ alias {{cmd}}i = __zoxide_zi # # source ~/.zoxide.nu # -# Note: zoxide only supports Nushell v0.86.0+. +# Note: zoxide only supports Nushell v0.89.0+.