refactor: create library with simple entrypoint in main

Create a library entrypoint 'src/lib.rs' and refactor binary entrypoint
'src/main.rs' accordingly.
This commit is contained in:
Matej Janezic 2023-05-27 12:52:10 +02:00
parent 423badfe07
commit a9a5e401dc
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
2 changed files with 11 additions and 5 deletions

10
src/lib.rs Normal file
View File

@ -0,0 +1,10 @@
#![allow(unused)]
pub mod cli;
pub mod scripts;
// NOTE: stolen from https://docs.rs/debug_print/latest/debug_print/
#[macro_export]
macro_rules! debug_println {
($($arg:tt)*) => (if ::std::cfg!(debug_assertions) { ::std::println!($($arg)*); })
}

View File

@ -1,11 +1,7 @@
#![allow(unused)] use ahab::{cli, scripts};
mod cli;
mod scripts;
use anyhow::Result; use anyhow::Result;
use clap::Parser; use clap::Parser;
use std::env;
fn main() -> Result<()> { fn main() -> Result<()> {
// always load dotenv on start // always load dotenv on start