From 28c011c7b3ebd8f5aae111551222ed3748937b33 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 3 Jun 2025 21:49:25 +0200 Subject: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Basic commands have been added, but most of the features for this project are still work in progress. Signed-off-by: Miquel Sabaté Solà --- crates/cli/src/nuke.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 crates/cli/src/nuke.rs (limited to 'crates/cli/src/nuke.rs') diff --git a/crates/cli/src/nuke.rs b/crates/cli/src/nuke.rs new file mode 100644 index 0000000..1ea6532 --- /dev/null +++ b/crates/cli/src/nuke.rs @@ -0,0 +1,36 @@ +fn help() { + println!("mihi nuke: Nuke the current installation.\n"); + println!("usage: mihi nuke [OPTIONS]\n"); + + println!("Options:"); + println!(" -h, --help\t\tPrint this message."); +} + +pub fn run(args: Vec) { + for arg in args { + match arg.as_str() { + "-h" | "--help" => { + help(); + std::process::exit(0); + } + _ => { + println!("error: nuke: unknown flag: '{}'", arg.as_str()); + std::process::exit(1); + } + } + } + + match mihi::get_config_path() { + Ok(path) => match std::fs::remove_dir_all(path) { + Ok(_) => {} + Err(e) => { + println!("error: nuke: {}", e); + std::process::exit(1); + } + }, + Err(e) => { + println!("error: nuke: {}", e); + std::process::exit(1); + } + } +} -- cgit v1.2.3