From 4847a89b410ba19580bf673398f468c535e5c4b3 Mon Sep 17 00:00:00 2001 From: fzdwx Date: Thu, 9 Feb 2023 14:16:23 +0800 Subject: [PATCH 1/4] fix choose --- man/just.1 | 2 +- src/config.rs | 4 ++-- tests/choose.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/man/just.1 b/man/just.1 index d0a9393526..5d6dda16e3 100644 --- a/man/just.1 +++ b/man/just.1 @@ -19,7 +19,7 @@ Run `\-\-fmt` in 'check' mode. Exits with 0 if justfile is formatted correctly. .TP \fB\-\-choose\fR Select one or more recipes to run using a binary. If `\-\-chooser` is not passed the -chooser defaults to the value of $JUST_CHOOSER, falling back to `fzf --preview 'just --show {}'` +chooser defaults to the value of $JUST_CHOOSER, falling back to `fzf -m --preview 'just --show {}'` .TP \fB\-\-clear\-shell\-args\fR Clear shell arguments diff --git a/src/config.rs b/src/config.rs index 069a9a8d20..8d68333d77 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,11 +4,11 @@ use { }; // These three strings should be kept in sync: -pub(crate) const CHOOSER_DEFAULT: &str = "fzf --preview 'just --show {}'"; +pub(crate) const CHOOSER_DEFAULT: &str = "fzf -m --preview 'just --show {}'"; pub(crate) const CHOOSER_ENVIRONMENT_KEY: &str = "JUST_CHOOSER"; pub(crate) const CHOOSE_HELP: &str = "Select one or more recipes to run using a binary. If \ `--chooser` is not passed the chooser defaults to the value \ - of $JUST_CHOOSER, falling back to `fzf`"; + of $JUST_CHOOSER, falling back to `fzf`()"; #[derive(Debug, PartialEq)] pub(crate) struct Config { diff --git a/tests/choose.rs b/tests/choose.rs index ed74638a13..14557d6ec5 100644 --- a/tests/choose.rs +++ b/tests/choose.rs @@ -152,7 +152,7 @@ fn invoke_error_function() { ", ) .stderr_regex( - r"error: Chooser `/ -cu fzf --preview 'just --show \{\}'` invocation failed: .*\n", + r"error: Chooser `/ -cu fzf -m --preview 'just --show \{\}'` invocation failed: .*\n", ) .status(EXIT_FAILURE) .shell(false) From 8dca30d35f5bc4bdd489654c61150c64c5cebae4 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 12 Jun 2023 18:03:00 +0100 Subject: [PATCH 2/4] Update src/config.rs --- src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 8d68333d77..781d1ef398 100644 --- a/src/config.rs +++ b/src/config.rs @@ -8,7 +8,7 @@ pub(crate) const CHOOSER_DEFAULT: &str = "fzf -m --preview 'just --show {}'"; pub(crate) const CHOOSER_ENVIRONMENT_KEY: &str = "JUST_CHOOSER"; pub(crate) const CHOOSE_HELP: &str = "Select one or more recipes to run using a binary. If \ `--chooser` is not passed the chooser defaults to the value \ - of $JUST_CHOOSER, falling back to `fzf`()"; + of $JUST_CHOOSER, falling back to `fzf`"; #[derive(Debug, PartialEq)] pub(crate) struct Config { From c609635f8575165b25cd290b3b94cfa3901c085e Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 12 Jun 2023 18:03:17 +0100 Subject: [PATCH 3/4] Fix man page --- man/just.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/just.1 b/man/just.1 index ec8d6c9567..c0b83aa8c8 100644 --- a/man/just.1 +++ b/man/just.1 @@ -19,7 +19,7 @@ and prints a diff if formatting is required. .TP \fB\-\-choose\fR Select one or more recipes to run using a binary. If `\-\-chooser` is not passed the chooser -defaults to the value of $JUST_CHOOSER, falling back to `fzf`() +defaults to the value of $JUST_CHOOSER, falling back to `fzf` .TP \fB\-\-clear\-shell\-args\fR Clear shell arguments From 32ea15828fadea9e40724e8e880754f03a56eb48 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 12 Jun 2023 18:03:56 +0100 Subject: [PATCH 4/4] Use long flag --- src/config.rs | 2 +- tests/choose.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 781d1ef398..322ac9412a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,7 +4,7 @@ use { }; // These three strings should be kept in sync: -pub(crate) const CHOOSER_DEFAULT: &str = "fzf -m --preview 'just --show {}'"; +pub(crate) const CHOOSER_DEFAULT: &str = "fzf --multi --preview 'just --show {}'"; pub(crate) const CHOOSER_ENVIRONMENT_KEY: &str = "JUST_CHOOSER"; pub(crate) const CHOOSE_HELP: &str = "Select one or more recipes to run using a binary. If \ `--chooser` is not passed the chooser defaults to the value \ diff --git a/tests/choose.rs b/tests/choose.rs index 14557d6ec5..153a704150 100644 --- a/tests/choose.rs +++ b/tests/choose.rs @@ -152,7 +152,7 @@ fn invoke_error_function() { ", ) .stderr_regex( - r"error: Chooser `/ -cu fzf -m --preview 'just --show \{\}'` invocation failed: .*\n", + r"error: Chooser `/ -cu fzf --multi --preview 'just --show \{\}'` invocation failed: .*\n", ) .status(EXIT_FAILURE) .shell(false)