bare-script 0.1.1

The type-safe scripting authority for Rust. A framework for building robust shell commands and automation with 'Parse, don't validate' philosophy.
Documentation
//! bare-script: The type-safe scripting authority for Rust.
//!
//! A framework for building robust shell commands and automation
//! with "Parse, don't validate" philosophy.
//!
//! # Overview
//!
//! This library provides two APIs:
//! - **Sync API** (`sync::CommandBuilder`): Uses `std::process::Command`
//! - **Async API** (`proc::CommandBuilder`): Uses `tokio::process::Command`
//!
//! # Quick Start - Sync
//!
//! ```rust
//! use bare_script::sync::CommandBuilder;
//!
//! #[cfg(not(windows))]
//! {
//! let output = CommandBuilder::new("echo")
//!     .arg("Hello, world!")
//!     .capture_output()
//!     .execute();
//!
//! assert!(output.is_ok());
//! assert!(output.unwrap().success());
//! }
//! ```
//!
//! # Quick Start - Async
//!
//! ```rust
//! use bare_script::proc::CommandBuilder;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), bare_script::ScriptError> {
//!     #[cfg(not(windows))]
//!     {
//!     let output = CommandBuilder::new("echo")
//!         .arg("Hello, world!")
//!         .capture_output()
//!         .execute()
//!         .await;
//!
//!     assert!(output.is_ok());
//!     assert!(output.unwrap().success());
//!     }
//!     Ok(())
//! }
//! ```

#![warn(missing_docs)]

pub mod args;
pub mod config;
pub mod error;
pub mod logging;
pub mod output;
pub mod proc;
pub mod shell;
pub mod sync;

pub use args::{Arg, ArgType, Args};
pub use config::{Config, StdioConfig};
pub use error::{ScriptError, ScriptResult};
pub use output::Output;

#[cfg(feature = "tokio-rt")]
pub use proc::CommandBuilder as AsyncCommandBuilder;

#[cfg(not(feature = "tokio-rt"))]
#[deprecated(since = "0.1.0", note = "Enable tokio-rt feature to use async API")]
pub type AsyncCommandBuilder = sync::CommandBuilder;

pub use sync::CommandBuilder;
pub use sync::Pipeline;

#[cfg(feature = "tokio-rt")]
pub use proc::Pipeline as AsyncPipeline;