X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=rust-src%2Fsrc%2Fcmd_mount.rs;h=3f8253f5e1f56781a22fdf6ee7cf6b0ccacdd85b;hb=9a9af6e9e6560407326b37345ebe434a0839420f;hp=a75dd21fc39ebf7cf1986d265b9ff96bda13b706;hpb=b90031efaa4500b8ce5ffc55e9d1ed716196b814;p=bcachefs-tools-debian diff --git a/rust-src/src/cmd_mount.rs b/rust-src/src/cmd_mount.rs index a75dd21..3f8253f 100644 --- a/rust-src/src/cmd_mount.rs +++ b/rust-src/src/cmd_mount.rs @@ -4,10 +4,9 @@ use log::{info, debug, error, LevelFilter}; use clap::{Parser}; use uuid::Uuid; use std::path::PathBuf; -use crate::{key, transform_c_args}; +use crate::key; use crate::key::KeyLocation; -use crate::logger::SimpleLogger; -use std::ffi::{CString, c_int, c_char, c_void}; +use std::ffi::{CString, c_int, c_char, c_void, OsStr}; use std::os::unix::ffi::OsStrExt; fn mount_inner( @@ -222,14 +221,9 @@ fn cmd_mount_inner(opt: Cli) -> anyhow::Result<()> { Ok(()) } -#[no_mangle] -#[allow(clippy::not_unsafe_ptr_arg_deref)] -pub extern "C" fn cmd_mount(argc: c_int, argv: *const *const c_char) -> c_int { - transform_c_args!(argv, argc, argv); +pub fn cmd_mount(argv: Vec<&OsStr>) -> c_int { let opt = Cli::parse_from(argv); - log::set_boxed_logger(Box::new(SimpleLogger)).unwrap(); - // @TODO : more granular log levels via mount option log::set_max_level(match opt.verbose { 0 => LevelFilter::Warn,