entrypoint 0.2.0

opinionated application framework/wrapper that eliminates main function boilerplate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! make sure async/tokio works

use entrypoint::prelude::*;

#[derive(entrypoint::clap::Parser, DotEnvDefault, LoggerDefault, Debug)]
#[log_writer(std::io::sink)]
#[command(author, version, about, long_about = None)]
struct Args {}

#[tokio::main]
#[entrypoint::entrypoint]
#[test]
async fn entrypoint(_args: Args) -> entrypoint::anyhow::Result<()> {
    tokio::time::sleep(std::time::Duration::from_millis(1)).await;
    assert!(enabled!(entrypoint::Level::INFO));
    Ok(())
}