#![deny(clippy::print_stderr)]
#![deny(clippy::print_stdout)]
#![deny(clippy::unused_async)]
#![deny(clippy::future_not_send)]
#![cfg_attr(not(doctest), doc = include_str!("../README.md"))]
pub mod parser;
#[cfg(feature = "shell")]
mod shell;
#[cfg(feature = "shell")]
pub use shell::*;
#[cfg(feature = "shell")]
#[macro_export]
macro_rules! sh {
($cmd:literal) => {
async {
let parsed_list = $crate::parser::parse($cmd)?;
Ok::<i32, Box<dyn std::error::Error>>($crate::shell::execute(
parsed_list,
$crate::shell::ExecuteOptionsBuilder::new()
.cwd(std::env::current_dir()?)
.build()
.unwrap(), ).await)
}
};
( $( $cmd:literal ),+ $(,)? ) => {
async {
let mut exit_codes = Vec::new();
$(exit_codes.push(sh!($cmd).await?);)+
Ok::<Vec<i32>, Box<dyn std::error::Error>>(exit_codes)
}
};
}