diff --git a/crates/pacdef_core/src/core.rs b/crates/pacdef_core/src/core.rs index 204f81c..74b3139 100644 --- a/crates/pacdef_core/src/core.rs +++ b/crates/pacdef_core/src/core.rs @@ -404,8 +404,16 @@ fn show_error(error: &anyhow::Error, backend: &dyn Backend) { /// If the crate was compiled from git, return `pacdef, ()`. /// Otherwise return `pacdef, `. -const fn get_name_and_version() -> &'static str { - formatcp!("pacdef, version: {}", get_version_string()) +fn get_name_and_version() -> String { + let backends = get_included_backends(); + let mut result = format!("pacdef, version: {}\n", get_version_string()); + result.push_str("supported backends:"); + for b in backends { + result.push_str("\n "); + result.push_str(b); + } + + result } /// If the crate was compiled from git, return ` ()`. Otherwise @@ -420,3 +428,12 @@ pub const fn get_version_string() -> &'static str { formatcp!("{VERSION} ({HASH})") } } + +fn get_included_backends() -> Vec<&'static str> { + let mut result = vec![]; + for backend in Backends::iter() { + result.push(backend.get_section()) + } + result.sort_unstable(); + result +}