intelli-shell 3.4.0

Like IntelliSense, but for shells
/// Macro to format an error message with theme's error style.
///
/// # Examples
/// ```rust
/// # use intelli_shell::format_error;
/// # use intelli_shell::config::Theme;
/// # let theme = Theme::default();
/// let msg = format_error!(theme, "Invalid value");
/// let msg = format_error!(theme, "Invalid value: {}", 42);
/// ```
#[macro_export]
macro_rules! format_error {
    ($theme:expr, $($arg:tt)*) => {
        format!("{}{}", $theme.error.apply("[Error] "), format!($($arg)*))
    }
}

/// Macro to format an information message with theme's style.
///
/// # Examples
/// ```rust
/// # use intelli_shell::format_msg;
/// # use intelli_shell::config::Theme;
/// # let theme = Theme::default();
/// let msg = format_msg!(theme, "Succesful operation");
/// ```
#[macro_export]
macro_rules! format_msg {
    ($theme:expr, $($arg:tt)*) => {
        format!("{}{}", $theme.accent.apply("-> "), format!($($arg)*))
    }
}

/// Declares a `mod` and uses it
#[macro_export]
macro_rules! using {
    ($($v:vis $p:ident),* $(,)?) => {
        $(
            mod $p;
            $v use self::$p::*;
        )*
    }
}

/// Extension trait to provide a consistent "tag" string representation for versions.
pub trait VersionExt {
    /// Returns a string representation of the version in the format "vX.Y.Z"
    fn to_tag(&self) -> String;
}

impl VersionExt for semver::Version {
    fn to_tag(&self) -> String {
        format!("v{self}")
    }
}

using! {
    pub process,
    pub string,
    pub tags,
    pub fuzzy,
    pub variable,
    pub widget,
    pub history,
    pub completion,
    pub import_export,
    pub installation,
    pub markdown,
}