cargo-e 0.3.2

e is for Example. A command-line tool for running and exploring source, examples, and binaries from Rust projects. It will run the first example, if no options are given.
Documentation
/// Returns a vector of feature flag strings.
/// Enabled features are listed as-is while disabled ones are prefixed with "!".
pub fn get_feature_flags() -> Vec<&'static str> {
    [
        if cfg!(feature = "tui") { "tui" } else { "!tui" },
        if cfg!(feature = "concurrent") {
            "concurrent"
        } else {
            "!concurrent"
        },
        if cfg!(target_os = "windows") {
            "windows"
        } else {
            "!windows"
        },
        if cfg!(feature = "equivalent") {
            "equivalent"
        } else {
            "!equivalent"
        },
    ]
    .to_vec()
}

/// Returns a JSON string representation of the feature flags.
pub fn get_feature_flags_json() -> String {
    let flags = get_feature_flags();
    format!(
        "[{}]",
        flags
            .iter()
            .map(|flag| format!("\"{}\"", flag))
            .collect::<Vec<_>>()
            .join(", ")
    )
}