From 2ea4878bae8fb2bdd04f07d93aa919be6cfa0142 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 25 May 2026 20:56:17 +0300 Subject: feat: gate live handoff behind explicit flag --- src/main.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 9a33555e..28dfd29d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -345,7 +345,19 @@ fn main() -> io::Result<()> { } if args.get(1).map(|s| s.as_str()) == Some("update") { - match update::self_update() { + let options = match update::parse_self_update_args(&args[2..]) { + Ok(options) => options, + Err(err) if err.starts_with("usage:") => { + eprintln!("{err}"); + std::process::exit(0); + } + Err(err) => { + eprintln!("{err}"); + eprintln!("usage: herdr update [--handoff]"); + std::process::exit(2); + } + }; + match update::self_update(options) { Ok(_) => return Ok(()), Err(e) => { if e.starts_with("self-update is disabled") { @@ -365,7 +377,7 @@ fn main() -> io::Result<()> { println!(" herdr --session [options]"); println!(" herdr --remote [--session ]"); println!(" herdr session attach "); - println!(" herdr update"); + println!(" herdr update [--handoff]"); println!(" herdr server stop"); println!(" herdr server reload-config"); println!(" herdr config ..."); @@ -440,6 +452,7 @@ fn main() -> io::Result<()> { println!(" --remote Attach through SSH to a remote Herdr server"); println!(" --remote-keybindings "); println!(" Keybindings for --remote app attach (default: local)"); + println!(" --handoff Opt into live handoff for update or remote attach"); println!(" --default-config Print default configuration and exit"); println!(" --version, -V Print version and exit"); println!(" --help, -h Show this help"); -- cgit v1.2.3