Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chwd: Make argument for autoconfigure optional #133

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct Args {
pub list_all: bool,

/// Autoconfigure
#[arg(short, long, value_name = "classid", conflicts_with_all(["install", "remove"]))]
#[arg(short, long, value_name = "classid", conflicts_with_all(["install", "remove"]), default_missing_value = "any", num_args(0..=1))]
pub autoconfigure: Option<String>,

/// Toggle AI SDK profiles
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ fn prepare_autoconfigure(

let mut found_device = false;
for device in devices.iter() {
if device.class_id != autoconf_class_id {
if autoconf_class_id != "any" && device.class_id != autoconf_class_id {
continue;
}
found_device = true;
Expand All @@ -183,7 +183,9 @@ fn prepare_autoconfigure(
device.device_name
);
if profile.is_none() {
log::warn!("No config found for device: {device_info}");
if autoconf_class_id != "any" {
log::warn!("No config found for device: {device_info}");
}
continue;
}
let profile = profile.unwrap();
Expand Down
Loading