natter/src/main.rs
Tom Alexander 24bac982f1
Starting to create the renderer integrations.
These are the layer directly over dust which can be used by anything, not just blog posts.
2023-10-22 16:26:43 -04:00

37 lines
819 B
Rust

use std::process::ExitCode;
use clap::Parser;
use self::cli::parameters::Cli;
use self::cli::parameters::Commands;
use self::command::build::build_site;
use self::command::init::init_writer_folder;
use self::error::CustomError;
mod blog_post;
mod cli;
mod command;
mod config;
mod error;
mod render;
fn main() -> Result<ExitCode, CustomError> {
let rt = tokio::runtime::Runtime::new()?;
rt.block_on(async {
let main_body_result = main_body().await;
main_body_result
})
}
async fn main_body() -> Result<ExitCode, CustomError> {
let args = Cli::parse();
match args.command {
Commands::Init(args) => {
init_writer_folder(args).await?;
}
Commands::Build(args) => {
build_site(args).await?;
}
};
Ok(ExitCode::SUCCESS)
}