-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: restructurize the codebase
- Loading branch information
Showing
14 changed files
with
57 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use clap::Parser; | ||
|
||
use crate::{backend, config::CONFIG, data::aliases::Result}; | ||
|
||
/// The notification system which derives a notification to user | ||
/// using wayland client. | ||
#[derive(Parser)] | ||
#[command(version, about, name = env!("CARGO_PKG_NAME"))] | ||
pub enum Args { | ||
/// Starts the backend. Use it in systemd, openrc or any other services. | ||
Run, | ||
} | ||
|
||
impl Args { | ||
pub async fn process(&self) -> Result<()> { | ||
match self { | ||
Args::Run => { | ||
let _ = &*CONFIG; // Initializes the configuration. | ||
|
||
backend::run().await?; | ||
} | ||
} | ||
|
||
Ok(()) | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
mod backend; | ||
mod cli; | ||
mod config; | ||
mod core; | ||
mod data; | ||
mod dbus; | ||
mod render; | ||
|
||
use config::CONFIG; | ||
use clap::Parser; | ||
|
||
use cli::Args; | ||
use data::aliases::Result; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
dbg!(&*CONFIG); // &* used for initializing | ||
|
||
core::run().await?; | ||
Ok(()) | ||
let args = Args::parse(); | ||
args.process().await | ||
} |