history : reexecution (issues #27 #28) - expansion !! !N !prefix ^old^new dans le REPL + am history --rerun N avec confirmation (shell ou commande am)
This commit is contained in:
@@ -1056,6 +1056,14 @@ fn handle_input(
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
// History expansion: !! !N !prefix ^old^new (re-execution, issue #27).
|
||||
if let Some(expanded) = crate::history::expand(&crate::history::read_all(app, 500), line) {
|
||||
if expanded.trim().is_empty() {
|
||||
return Ok(false);
|
||||
}
|
||||
println!("{expanded}");
|
||||
return handle_input(app, session, last, &expanded);
|
||||
}
|
||||
// Slash commands (Hermes-style).
|
||||
if let Some(rest) = line.strip_prefix('/') {
|
||||
let (cmd, arg) = match rest.split_once(char::is_whitespace) {
|
||||
@@ -1260,6 +1268,7 @@ fn handle_line(
|
||||
failed: flag("--failed"),
|
||||
session: opt_value("--session"),
|
||||
limit: opt_value("--limit").and_then(|v| v.parse().ok()).unwrap_or(100),
|
||||
rerun: opt_value("--rerun").and_then(|v| v.parse().ok()),
|
||||
},
|
||||
"init" => Command::Init { force: flag("--force") },
|
||||
"search" => Command::Search {
|
||||
|
||||
Reference in New Issue
Block a user