diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 66bfc64d..dedcd384 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -84,6 +84,7 @@ mod ffi { // utils.rs extern "Rust" { fn varsubstitute(s: &str, vars: &Vec) -> Result; + fn get_features() -> Vec; } #[derive(Default)] diff --git a/rust/src/utils.rs b/rust/src/utils.rs index b2525b99..6ed8b447 100644 --- a/rust/src/utils.rs +++ b/rust/src/utils.rs @@ -294,3 +294,10 @@ pub(crate) fn varsubstitute(s: &str, subs: &Vec) -> R let m = subs.iter().cloned().map(|i| (i.k, i.v)).collect(); varsubst(s, &m) } + +pub(crate) fn get_features() -> Vec { + let mut r = Vec::new(); + #[cfg(feature = "fedora-integration")] + r.push("fedora-integration".to_string()); + r +} diff --git a/src/app/libmain.cxx b/src/app/libmain.cxx index 39130fd7..1b1e809c 100644 --- a/src/app/libmain.cxx +++ b/src/app/libmain.cxx @@ -32,6 +32,7 @@ #include "rpmostree-util.h" #include "rpmostree-builtins.h" +#include "rpmostree-cxxrs.h" #include "rpmostree-polkit-agent.h" #include "rpmostreemain.h" @@ -248,6 +249,11 @@ rpmostree_option_context_parse (GOptionContext *context, g_print (" Features:\n"); for (char **iter = features; iter && *iter; iter++) g_print (" - %s\n", *iter); + auto featuresrs = rpmostreecxx::get_features(); + for (auto s : featuresrs) + { + g_print (" - %s\n", s.c_str()); + } exit (EXIT_SUCCESS); }