From 302ec231baa05a09b6b6c3eb936866954faf5aeb Mon Sep 17 00:00:00 2001 From: c02y Date: Wed, 13 Apr 2022 19:33:06 +0800 Subject: [PATCH 1/2] --interactive/-i and --score/-s do not conflict in Query::query() (#342) --- CHANGELOG.md | 1 + contrib/completions/_zoxide | 4 ++-- src/cmd/_cmd.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba4f8f8..e48170a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Retain ownership of database file. - Elvish: upgrade to new try-catch syntax, upgrade minimum supported version to v0.18.0. +- `zoxide query --interactive` should not conflict with `--score`. ## [0.8.0] - 2021-12-25 diff --git a/contrib/completions/_zoxide b/contrib/completions/_zoxide index 21c33ee..312adb6 100644 --- a/contrib/completions/_zoxide +++ b/contrib/completions/_zoxide @@ -68,8 +68,8 @@ _arguments "${_arguments_options[@]}" \ '(-l --list)--interactive[Use interactive selection]' \ '(-i --interactive)-l[List all matching directories]' \ '(-i --interactive)--list[List all matching directories]' \ -'(-i --interactive)-s[Print score with results]' \ -'(-i --interactive)--score[Print score with results]' \ +'-s[Print score with results]' \ +'--score[Print score with results]' \ '-h[Print help information]' \ '--help[Print help information]' \ '-V[Print version information]' \ diff --git a/src/cmd/_cmd.rs b/src/cmd/_cmd.rs index 4e1b41b..f161ef0 100644 --- a/src/cmd/_cmd.rs +++ b/src/cmd/_cmd.rs @@ -112,7 +112,7 @@ pub struct Query { pub list: bool, /// Print score with results - #[clap(long, short, conflicts_with = "interactive")] + #[clap(long, short)] pub score: bool, /// Exclude a path from results From 24d21ec8ab1f091a2dd684a11e8807b7ff1428f3 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Sun, 17 Apr 2022 17:06:47 +0800 Subject: [PATCH 2/2] Simplify fish init script (#370) --- templates/fish.txt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/templates/fish.txt b/templates/fish.txt index c73a987..ff11078 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -102,20 +102,18 @@ end {%- match cmd %} {%- when Some with (cmd) %} -# Remove definitions. -function __zoxide_unset - set --erase $argv >/dev/null 2>&1 - abbr --erase $argv >/dev/null 2>&1 - builtin functions --erase $argv >/dev/null 2>&1 +function {{cmd}} + __zoxide_z $argv end - -__zoxide_unset {{cmd}} -alias {{cmd}}=__zoxide_z +abbr --erase {{cmd}} complete -c {{cmd}} -e complete -c {{cmd}} -f -a '(__zoxide_z_complete)' -__zoxide_unset {{cmd}}i -alias {{cmd}}i=__zoxide_zi +function {{cmd}}i + __zoxide_zi $argv +end +abbr --erase {{cmd}}i +complete -c {{cmd}}i -e {%- when None %}