diff --git a/README.md b/README.md index 3cae653..886f584 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,12 @@ Arguments: [ROOM] Room to join Options: - -n, --name Name to use for this session - -s, --server Websocket URL to connect to - -S, --skip-update-check Skip the automatic update check and stay on the current version - -h, --help Print help - -V, --version Print version + -n, --name Name to use for this session + -s, --server Websocket URL to connect to + -S, --skip-update-check Skip the automatic update check and stay on the current version + -N, --disable-notifications Disable notifications + -h, --help Print help + -V, --version Print version ``` You can also use environment variables to set each argument or option. For this prefix the option name with @@ -57,4 +58,5 @@ name = "ja-ko" room = "planning-room" server = "wss://pp.discordia.network/" skip_update_check = false +disable_notifications = false ``` diff --git a/src/cli.rs b/src/cli.rs index df8b3f9..c2e3c73 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -15,8 +15,12 @@ pub struct Cli { /// Room to join. #[arg()] pub(crate) room: Option, - + /// Skip the automatic update check and stay on the current version. #[arg(short = 'S', long)] pub(crate) skip_update_check: bool, + + /// Disable notifications + #[arg(short = 'N', long)] + pub(crate) disable_notifications: bool, } \ No newline at end of file diff --git a/src/config.rs b/src/config.rs index 4f8d00b..20bcef8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -32,7 +32,8 @@ pub struct Config { pub name: String, pub room: String, pub server: String, - pub skip_update_check: bool + pub skip_update_check: bool, + pub disable_notifications: bool, } impl Default for Config { @@ -42,6 +43,7 @@ impl Default for Config { room: petname::petname(3, "").expect("Failed to generate random room name"), server: "wss://pp.discordia.network/".to_owned(), skip_update_check: false, + disable_notifications: false, } } } diff --git a/src/main.rs b/src/main.rs index c5d18c5..e195b3f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,6 +81,9 @@ fn main() -> AppResult<()> { if cli.skip_update_check { config.skip_update_check = true; } + if cli.disable_notifications { + config.disable_notifications = true; + } let update = update()?; match update {