From 3a04a2fe26c15b59f6bd504a91871ac2d295cb22 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Thu, 1 Feb 2024 10:44:12 +0000 Subject: [PATCH] hypha: implement attach option on launch to connect to console --- hypha/bin/controller.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hypha/bin/controller.rs b/hypha/bin/controller.rs index aa4afbb..f7867d7 100644 --- a/hypha/bin/controller.rs +++ b/hypha/bin/controller.rs @@ -31,6 +31,8 @@ enum Commands { config_bundle: Option, #[arg[short, long]] env: Option>, + #[arg(short, long)] + attach: bool, #[arg()] image: String, #[arg(allow_hyphen_values = true, trailing_var_arg = true)] @@ -71,6 +73,7 @@ fn main() -> Result<()> { cpus, mem, config_bundle, + attach, env, run, } => { @@ -87,6 +90,9 @@ fn main() -> Result<()> { if run.is_empty() { None } else { Some(run) }, )?; println!("launched container: {}", uuid); + if attach { + controller.console(&uuid.to_string())?; + } } Commands::Destroy { container } => {