use linuxutils_common::man::ManContent;
pub const MAN: ManContent = ManContent::empty();
use clap::Parser;
use std::process::ExitCode;
#[derive(Parser)]
#[command(name = "pivot_root", about = "Change the root filesystem")]
pub struct Args {
new_root: String,
put_old: String,
}
pub fn run(args: Args) -> ExitCode {
if let Err(e) = rustix::process::pivot_root(&args.new_root, &args.put_old) {
eprintln!(
"pivot_root: failed to pivot from '{}' to '{}': {}",
args.new_root,
args.put_old,
std::io::Error::from(e)
);
return ExitCode::FAILURE;
}
ExitCode::SUCCESS
}