Files
rgit/src/subcommands/test.rs
Antonin Ruan f45dde90d2 Init commit
2026-02-19 14:46:58 +01:00

30 lines
619 B
Rust

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(""))
}
}