feat: add new subcommand to open default editor with metadata

This commit is contained in:
2026-08-30 21:28:11 +02:00
parent 5a5a4f4330
commit cd9ec1d9b1
2 changed files with 42 additions and 0 deletions
+11
View File
@@ -8,6 +8,9 @@ use std::path::PathBuf;
mod move_files;
use move_files::move_files;
mod edit;
use edit::edit;
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Args {
@@ -25,6 +28,9 @@ enum Commands {
Show {
file: PathBuf,
},
Edit {
file: PathBuf,
},
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -61,6 +67,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("{:?}", item)
}
}
Commands::Edit { file } => {
let path = PathBuf::from("/tmp/keks-sort-metadata");
let tag = get_metadata(file);
edit(path, tag);
}
}
Ok(())