diff --git a/sfsmcctl/src/main.rs b/sfsmcctl/src/main.rs new file mode 100644 index 0000000..e17e671 --- /dev/null +++ b/sfsmcctl/src/main.rs @@ -0,0 +1,28 @@ +use log::{ debug, info, warn, error }; + +#[tokio::main] +async fn main() -> Result<(), Box> { + // env_logger initialization + // If running with debug profile and `RUST_LOG` environment variable isn't set, set it to "debug" + if cfg!(debug_assertions) && std::env::var_os(env_logger::DEFAULT_FILTER_ENV).is_none() { + std::env::set_var(env_logger::DEFAULT_FILTER_ENV, "debug"); + } + env_logger::init(); + + // TODO: use clap + + // Connect with D-Bus + let (resource, c) = dbus_tokio::connection::new_system_sync()?; + debug!("D-Bus unique name: {}", c.unique_name()); + + // Spawn a new task for the D-Bus resource + tokio::spawn(async move { + let err = resource.await; + panic!("Lost connection to D-Bus: {}", err); + }); + + // TODO: + // Perform operations + + Ok(()) +} \ No newline at end of file