Signed-off-by: Malte Schröder <[email protected]>
---
 src/commands/subvolume.rs | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/commands/subvolume.rs b/src/commands/subvolume.rs
index bb0141c4..7df20819 100644
--- a/src/commands/subvolume.rs
+++ b/src/commands/subvolume.rs
@@ -24,7 +24,7 @@ enum Subcommands {
     #[command(visible_aliases = ["del"])]
     Delete {
         /// Path
-        target: PathBuf,
+        targets: Vec<PathBuf>,
     },
 
     #[command(allow_missing_positional = true, visible_aliases = ["snap"])]
@@ -58,15 +58,17 @@ pub fn subvolume(argv: Vec<String>) -> Result<()> {
                 }
             }
         }
-        Subcommands::Delete { target } => {
-            let target = target
-                .canonicalize()
-                .context("subvolume path does not exist or can not be 
canonicalized")?;
+        Subcommands::Delete { targets } => {
+            for target in targets {
+                let target = target
+                    .canonicalize()
+                    .context("subvolume path does not exist or can not be 
canonicalized")?;
 
-            if let Some(dirname) = target.parent() {
-                let fs = unsafe { BcachefsHandle::open(dirname) };
-                fs.delete_subvolume(target)
-                    .context("Failed to delete the subvolume")?;
+                if let Some(dirname) = target.parent() {
+                    let fs = unsafe { BcachefsHandle::open(dirname) };
+                    fs.delete_subvolume(target)
+                        .context("Failed to delete the subvolume")?;
+                }
             }
         }
         Subcommands::Snapshot {
-- 
2.47.0


Reply via email to