|

cli: cmd_remove prompt spells out what gets deleted; source repo path called out explicitly

Author: Chris Tusa <chris.tusa@leafscale.com>
Date: May 11, 2026 15:47
Node: c14021a870d8c722805a6dfa0a2461f3c99ca638
Branch: default
Tags: v0.4.3

Changed files:

Diff

diff -r 9e1f79d090f2 -r c14021a870d8 reef.toml
--- a/reef.toml	Mon May 11 15:24:12 2026 -0500
+++ b/reef.toml	Mon May 11 15:47:47 2026 -0500
@@ -1,6 +1,6 @@
 [package]
 name = "repoman"
-version = "0.4.2"
+version = "0.4.3"
 author = "Chris Tusa <christusa@gmail.com>"
 description = "Per-project Incus containers + opinionated NFS/ZFS backup"
 license = "MIT"
diff -r 9e1f79d090f2 -r c14021a870d8 src/cli.reef
--- a/src/cli.reef	Mon May 11 15:24:12 2026 -0500
+++ b/src/cli.reef	Mon May 11 15:47:47 2026 -0500
@@ -617,16 +617,6 @@
     let name: string = positionals[0]
     let keep_incus: bool = flag.get_bool(parser, "keep-incus")
 
-    // Confirmation: --yes skips the prompt; otherwise ask the user (defaults to no).
-    let auto_confirmed: bool = flag.get_bool(parser, "yes")
-    if not auto_confirmed
-        let proceed: bool = console.confirm_default_no("remove project '" + name + "'? this is destructive")
-        if not proceed
-            println("aborted")
-            return 4
-        end if
-    end if
-
     let home: string = env.get_env_or("HOME", "")
     if str.length(home) == 0
         console.printErr("repoman: error: HOME is not set")
@@ -641,7 +631,7 @@
     end if
     let reg: config.Registry = rg.unwrap_ok(reg_r)
 
-    // Confirm name is actually in registry before doing anything destructive.
+    // Confirm name is actually in registry before prompting or doing anything destructive.
     let pn: int = reg.projects.length()
     mut found: int = -1
     mut i: int = 0
@@ -656,7 +646,28 @@
         return 1
     end if
 
-    // Open log AFTER we know the name is real.
+    // Confirmation: --yes skips the prompt; otherwise spell out exactly what
+    // gets removed so the user isn't left wondering whether their source is at risk.
+    let auto_confirmed: bool = flag.get_bool(parser, "yes")
+    if not auto_confirmed
+        let repo_path: string = reg.projects[found].repo
+        println("This will remove:")
+        if keep_incus
+            println("  - registry entry for '" + name + "' in " + cfg_path)
+            println("  (incus container kept: --keep-incus)")
+        else
+            println("  - incus container '" + name + "' (project 'repoman')")
+            println("  - registry entry for '" + name + "' in " + cfg_path)
+        end if
+        println("Your source repository at " + repo_path + " on the host will NOT be touched.")
+        let proceed: bool = console.confirm_default_no("continue?")
+        if not proceed
+            println("aborted")
+            return 4
+        end if
+    end if
+
+    // Open log AFTER the user has confirmed.
     let _ol: bool = log.open_log(reg.defaults.logdir, name, "remove")
 
     // Step 1: delete the incus container (unless --keep-incus).