添加注释

main
阳光少年 1 year ago
parent 57419f6662
commit 4944cb2346

@ -490,14 +490,16 @@ fn delete_container(containers_id: &str) -> Result<()> {
fn main() -> Result<()>{ fn main() -> Result<()>{
let args = RockerArgs::parse(); let args = RockerArgs::parse();
// run
if let (Some(cmd), Some(image_name)) = (&args.run, &args.image) { if let (Some(cmd), Some(image_name)) = (&args.run, &args.image) {
// run
let volume_path = extend_image(image_name)?; let volume_path = extend_image(image_name)?;
let (container_id, pid) = run_container(cmd, &args, &volume_path)?; let (container_id, pid) = run_container(cmd, &args, &volume_path)?;
save_container_info(&args, &container_id, pid)?; // todo 无论出不错, 都要保存一个信息, 后面需要删除用清理 save_container_info(&args, &container_id, pid)?; // todo 无论出不错, 都要保存一个信息, 后面需要删除用清理
} else if args.ps || args.psa { } else if args.ps || args.psa {
// --ps
show_containers(args.psa)? show_containers(args.psa)?
} else if let Some(containers_id) = &args.rm { } else if let Some(containers_id) = &args.rm {
// --rm
delete_container(containers_id)?; delete_container(containers_id)?;
} }
@ -505,8 +507,6 @@ fn main() -> Result<()>{
// logs // logs
// rm
Ok(()) Ok(())
} }
Loading…
Cancel
Save