Skip to content

Commit

Permalink
Add CLI option to not persist profile change
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyCoolSlug committed Mar 29, 2024
1 parent a1ee428 commit 1d7ecb9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions client/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ pub enum ProfileAction {
Load {
/// The profile name to load
profile_name: String,

/// Persist the Load
#[arg(num_args=0..=1, default_missing_value="true")]
persist: Option<bool>,
},

/// Load a Profiles Colours Only
Expand Down
20 changes: 16 additions & 4 deletions client/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,17 @@ pub async fn run_cli() -> Result<()> {
.await
.context("Unable to create new profile")?;
}
ProfileAction::Load { profile_name } => {
ProfileAction::Load {
profile_name,
persist,
} => {
client
.command(
&serial,
GoXLRCommand::LoadProfile(profile_name.to_string(), true),
GoXLRCommand::LoadProfile(
profile_name.to_string(),
persist.unwrap_or(true),
),
)
.await
.context("Unable to Load Profile")?;
Expand Down Expand Up @@ -491,11 +497,17 @@ pub async fn run_cli() -> Result<()> {
.await
.context("Unable to create new profile")?;
}
ProfileAction::Load { profile_name } => {
ProfileAction::Load {
profile_name,
persist,
} => {
client
.command(
&serial,
GoXLRCommand::LoadMicProfile(profile_name.to_string(), true),
GoXLRCommand::LoadMicProfile(
profile_name.to_string(),
persist.unwrap_or(true),
),
)
.await
.context("Unable to Load Microphone Profile")?;
Expand Down

0 comments on commit 1d7ecb9

Please sign in to comment.