diff --git a/src/subcommand/init/shell/fish.rs b/src/subcommand/init/shell/fish.rs index bd4b36f..c840b07 100644 --- a/src/subcommand/init/shell/fish.rs +++ b/src/subcommand/init/shell/fish.rs @@ -13,7 +13,7 @@ pub const CONFIG: ShellConfig = ShellConfig { }, }; -fn z(z_cmd: &str) -> String { +fn z(cmd: &str) -> String { format!( r#" function _z_cd @@ -52,11 +52,11 @@ function {} end end "#, - z_cmd + cmd ) } -fn alias(z_cmd: &str) -> String { +fn alias(cmd: &str) -> String { format!( r#" abbr -a {0}i '{0} -i' @@ -69,7 +69,7 @@ abbr -a {0}qi 'zoxide query -i' abbr -a {0}r 'zoxide remove' abbr -a {0}ri 'zoxide remove -i' "#, - z_cmd + cmd ) } diff --git a/src/subcommand/init/shell/powershell.rs b/src/subcommand/init/shell/powershell.rs index ae5b5f6..f33ac54 100644 --- a/src/subcommand/init/shell/powershell.rs +++ b/src/subcommand/init/shell/powershell.rs @@ -13,7 +13,7 @@ pub const CONFIG: ShellConfig = ShellConfig { }, }; -fn z(z_cmd: &str) -> String { +fn z(cmd: &str) -> String { format!( r#" function {} {{ @@ -43,24 +43,24 @@ function {} {{ }} }} "#, - z_cmd + cmd ) } -fn alias(z_cmd: &str) -> String { +fn alias(cmd: &str) -> String { format!( r#" -function zi {{ {} -i @args }} +function {0}i {{ {0} -i @args }} -function za {{ zoxide add @args }} +function {0}a {{ zoxide add @args }} -function zq {{ zoxide query @args }} -function zqi {{ zoxide query -i @args }} +function {0}q {{ zoxide query @args }} +function {0}qi {{ zoxide query -i @args }} -function zr {{ zoxide remove @args }} -function zri {{ zoxide remove -i @args }} +function {0}r {{ zoxide remove @args }} +function {0}ri {{ zoxide remove -i @args }} "#, - z_cmd + cmd ) }