This commit is contained in:
sxyazi 2024-07-18 13:55:41 +08:00
parent 872d9a285b
commit 67e7b79148
No known key found for this signature in database
2 changed files with 2 additions and 5 deletions

View file

@ -33,8 +33,6 @@ impl Control {
if let Some(ref s) = self.desc { Cow::Borrowed(s) } else { self.run().into() } if let Some(ref s) = self.desc { Cow::Borrowed(s) } else { self.run().into() }
} }
pub fn key_desc(&self) -> String { format!("`{}` ({})", self.on(), self.desc_or_run()) }
#[inline] #[inline]
pub fn contains(&self, s: &str) -> bool { pub fn contains(&self, s: &str) -> bool {
let s = s.to_lowercase(); let s = s.to_lowercase();

View file

@ -65,12 +65,11 @@ pub fn init() -> anyhow::Result<()> {
continue; continue;
} }
if !r.bool("confirm") && !r.bool("interactive") { if !r.bool("confirm") && !r.bool("interactive") {
let key_desc = c.key_desc(); let s = format!("`{}` ({})", c.on(), c.desc_or_run());
eprintln!( eprintln!(
r#"WARNING: In Yazi v0.3, the behavior of the interactive `shell` (i.e., shell templates) must be explicitly specified with either `--interactive` or `--confirm`. r#"WARNING: In Yazi v0.3, the behavior of the interactive `shell` (i.e., shell templates) must be explicitly specified with either `--interactive` or `--confirm`.
Please replace e.g. `shell` with `shell --interactive`, `shell "my-template"` with `shell "my-template" --interactive`, in your keymap.toml Please replace e.g. `shell` with `shell --interactive`, `shell "my-template"` with `shell "my-template" --interactive`, in your keymap.toml for the key: {s}"#
for the key {key_desc}"#
); );
return Ok(()); return Ok(());
} else if r.bool("confirm") && r.bool("interactive") { } else if r.bool("confirm") && r.bool("interactive") {