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

More crutest and dsc updates to support Volume layer activities. #1472

Merged
merged 4 commits into from
Sep 26, 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: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions crutest/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ pub struct CliAction {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Debug, Parser, PartialEq)]
pub enum DscCommand {
/// Connect to the default DSC server (http://127.0.0.1:9998)
Connect,
/// IP:Port for a dsc server
/// #[clap(long, global = true, default_value = "127.0.0.1:9998", action)]
Connect { server: SocketAddr },
/// Disable random stopping of downstairs
DisableRandomStop,
/// Disable auto restart on the given downstairs client ID
Expand Down Expand Up @@ -380,7 +381,7 @@ async fn handle_dsc(
) {
if let Some(dsc_client) = dsc_client {
match dsc_cmd {
DscCommand::Connect => {
DscCommand::Connect { .. } => {
println!("Already connected");
}
DscCommand::DisableRandomStop => {
Expand Down Expand Up @@ -444,9 +445,9 @@ async fn handle_dsc(
println!("Got res: {:?}", res);
}
}
} else if dsc_cmd == DscCommand::Connect {
let url = "http://127.0.0.1:9998".to_string();
println!("Connect to {:?}", url);
} else if let DscCommand::Connect { server } = dsc_cmd {
let url = format!("http://{}", server).to_string();
println!("Connecting to {:?}", url);
let rs = Client::new(&url);
*dsc_client = Some(rs);
} else {
Expand Down
Loading