aboutsummaryrefslogtreecommitdiff
path: root/crates/cli/src/nuke.rs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-06-03 21:49:25 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-06-03 21:49:25 +0200
commit28c011c7b3ebd8f5aae111551222ed3748937b33 (patch)
treef6310107b9fbdabeda1cce46e2feb2cb85d1ce1a /crates/cli/src/nuke.rs
downloadmihi-28c011c7b3ebd8f5aae111551222ed3748937b33.tar.gz
mihi-28c011c7b3ebd8f5aae111551222ed3748937b33.zip
Initial commit
Basic commands have been added, but most of the features for this project are still work in progress. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'crates/cli/src/nuke.rs')
-rw-r--r--crates/cli/src/nuke.rs36
1 files changed, 36 insertions, 0 deletions
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<String>) {
+ 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);
+ }
+ }
+}