Skip to content

Commit e956708

Browse files
authored
Autojump argument parsing (#1077)
I've changed the number of arguments of `def --env j [dir]` to `def --env j [...dir]`, this change makes the behaviour more like the `j` autojump you can find in other shells where an arbitrary number of inputs are given to it. ie. In zsh: ![image](https://github.com/user-attachments/assets/5de5611e-2681-46a0-93c4-d6e68922df13) In nushell old j: ![image](https://github.com/user-attachments/assets/966dc6b0-cd9f-4d19-b662-e561c42bca83) In nushell new j: ![image](https://github.com/user-attachments/assets/a73d10a1-1313-4dd8-815e-9e8a15a16101)
1 parent 13de337 commit e956708

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nu-hooks/nu-hooks/filesystem/autojump.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ def autojump_add_to_database [dir] {
1414
$env.AUTOJUMP_SOURCED = 1
1515
autojump --add $dir
1616
}
17-
def --env j [dir] {
17+
def --env j [...dir] {
1818
$env.AUTOJUMP_SOURCED = 1
19-
cd (autojump $dir)
19+
cd (autojump ...$dir)
2020
}
2121
$env.config = ($env.config | upsert hooks.env_change.PWD {|config|
2222
let val = ($config | get -i hooks.env_change.PWD)

0 commit comments

Comments
 (0)