]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - src/commands/mod.rs
Update upstream source from tag 'v1.6.3'
[bcachefs-tools-debian] / src / commands / mod.rs
similarity index 50%
rename from rust-src/src/lib.rs
rename to src/commands/mod.rs
index 64297b41d7dce8d56c6a1bdbb0c6ef7ea74add00..70fef82cdbe8425c96ec5b417212d182aa160d49 100644 (file)
@@ -1,10 +1,10 @@
 use clap::Subcommand;
 
-pub mod key;
 pub mod logger;
 pub mod cmd_mount;
 pub mod cmd_list;
 pub mod cmd_completions;
+pub mod cmd_subvolume;
 
 #[derive(clap::Parser, Debug)]
 #[command(name = "bcachefs")]
@@ -18,6 +18,8 @@ enum Subcommands {
     List(cmd_list::Cli),
     Mount(cmd_mount::Cli),
     Completions(cmd_completions::Cli),
+    #[command(visible_aliases = ["subvol"])]
+    Subvolume(cmd_subvolume::Cli),
 }
 
 #[macro_export]
@@ -30,24 +32,3 @@ macro_rules! c_str {
         }
     };
 }
-
-#[macro_export]
-macro_rules! transform_c_args {
-    ($var:ident, $argc:expr, $argv:expr) => {
-        // TODO: `OsStr::from_bytes` only exists on *nix
-        use ::std::os::unix::ffi::OsStrExt;
-        let $var: Vec<_> = (0..$argc)
-        .map(|i| unsafe { ::std::ffi::CStr::from_ptr(*$argv.add(i as usize)) })
-        .map(|i| ::std::ffi::OsStr::from_bytes(i.to_bytes()))
-        .collect();
-    };
-}
-
-#[derive(Debug)]
-struct ErrnoError(errno::Errno);
-impl std::fmt::Display for ErrnoError {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
-        self.0.fmt(f)
-    }
-}
-impl std::error::Error for ErrnoError {}