Init commit

This commit is contained in:
Antonin Ruan
2026-02-19 14:46:58 +01:00
commit f45dde90d2
12 changed files with 993 additions and 0 deletions

29
src/subcommands/test.rs Normal file
View File

@@ -0,0 +1,29 @@
use clap::Parser;
use std::fs;
use crate::subcommands::Subcommand;
use super::CmdResult;
#[derive(Parser, Debug)]
pub struct TestSubcommand {
path: String
}
impl Subcommand for TestSubcommand {
fn run(&self) -> CmdResult {
let metadata = match fs::metadata(self.path.clone()) {
Ok(metadata) => metadata,
_ => return Err(String::from("")),
};
let mtime = match metadata.modified() {
Ok(mtime) => mtime,
_ => return Err(String::from("")),
};
// mtime
println!("{mtime:?}");
Ok(String::from(""))
}
}