30 lines
619 B
Rust
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(""))
|
|
}
|
|
}
|