cdk_ansible_cli/lib.rs
1//!
2//! This is a crate for `cdk-ansible` command.
3//!
4//! # Usage
5//!
6//! ```bash
7//! cdk-ansible module --help
8//! ```
9//!
10
11use anyhow::Result;
12use std::num::NonZero;
13
14/// Define commands
15mod cli;
16use cli::Cli;
17mod utils;
18mod version;
19
20#[inline]
21pub fn run() -> Result<()> {
22 let nprocs = std::thread::available_parallelism()
23 .map(NonZero::get)
24 .unwrap_or_default();
25 let threads = nprocs; // TODO: use env var
26 tokio::runtime::Builder::new_multi_thread()
27 .enable_all()
28 .worker_threads(threads)
29 .build()?
30 .block_on(Cli::run(std::env::args().collect()))
31}