2022-08-16 09:05:18 +01:00
|
|
|
pub mod args;
|
|
|
|
pub mod commands;
|
|
|
|
pub mod meta;
|
|
|
|
pub mod types;
|
|
|
|
pub mod utils;
|
|
|
|
|
2022-10-22 14:16:02 +01:00
|
|
|
use args::{CLIArgs, Commands};
|
|
|
|
use clap::Parser;
|
|
|
|
|
|
|
|
use commands::copy::copy_command;
|
|
|
|
use commands::genhtml::genhtml_command;
|
2022-12-14 14:08:46 +00:00
|
|
|
use commands::get_tags::get_tags_command;
|
2022-10-22 14:16:02 +01:00
|
|
|
use commands::process::process_command;
|
2022-12-14 14:08:46 +00:00
|
|
|
use commands::set_tags::set_tags_command;
|
2022-10-22 14:16:02 +01:00
|
|
|
use commands::transcode::transcode_command;
|
|
|
|
|
2022-08-16 09:05:18 +01:00
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
|
let cli = CLIArgs::parse();
|
|
|
|
|
|
|
|
match cli.command.as_ref() {
|
|
|
|
Some(Commands::Process(process_args)) => {
|
|
|
|
process_command(&cli, process_args)?;
|
|
|
|
}
|
|
|
|
Some(Commands::Genhtml(genhtml_args)) => {
|
|
|
|
genhtml_command(&cli, genhtml_args)?;
|
|
|
|
}
|
|
|
|
Some(Commands::Transcode(transcode_args)) => {
|
|
|
|
transcode_command(&cli, transcode_args)?;
|
|
|
|
}
|
|
|
|
Some(Commands::Copy(copy_args)) => {
|
|
|
|
copy_command(&cli, copy_args)?;
|
|
|
|
}
|
2022-12-14 14:08:46 +00:00
|
|
|
Some(Commands::SetTags(set_tags_args)) => {
|
|
|
|
set_tags_command(&cli, set_tags_args)?;
|
|
|
|
}
|
|
|
|
Some(Commands::GetTags(get_tags_args)) => {
|
|
|
|
get_tags_command(&cli, get_tags_args)?;
|
|
|
|
}
|
2022-08-16 09:05:18 +01:00
|
|
|
None => {
|
|
|
|
panic!("please provide a subcommand");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|