clap_reverse_impl 0.1.1

Internal subcrate for `clap_reverse` crate
Documentation
/// Converts a Rust struct into a [`std::process::Command`].
///
/// This trait is mainly implemented by the `ClapReverse` procedural macro,
/// allowing structs with annotated fields to be turned into fully-formed commands.
///
/// # Example
///
/// ```rust,ignore
/// use clap_reverse::{ClapReverse, AsCommand};
/// 
/// #[derive(ClapReverse)]
/// #[clap_reverse(binary = "echo")]
/// struct Echo {
///     #[clap_reverse(transparent)]
///     text: String,
/// }
///
/// let echo = Echo {
///     text: "Hello".to_string(),
/// };
///
/// let cmd = echo.as_command();
/// // `cmd` is now a `std::process::Command` ready to spawn
/// // `cmd` string representations is: "echo Hello"
/// // `cmd` output will be "Hello"
/// ```
pub trait AsCommand {
    /// Builds a [`std::process::Command`] from the struct.
    ///
    /// All required arguments and flags are included according to the
    /// struct’s field annotations.
    fn as_command(&self) -> std::process::Command;
}