Skip to content

Commit

Permalink
CLI: simplify display::print_cluster_responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Keksoj committed May 22, 2023
1 parent ec6c58e commit fcbe244
Show file tree
Hide file tree
Showing 2 changed files with 211 additions and 200 deletions.
14 changes: 7 additions & 7 deletions bin/src/ctl/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use crate::ctl::{
create_channel,
display::{
print_available_metrics, print_certificates_by_worker, print_certificates_with_validity,
print_frontend_list, print_json_response, print_listeners, print_metrics,
print_query_response_data, print_status,
print_cluster_responses, print_frontend_list, print_json_response, print_listeners,
print_metrics, print_status,
},
CommandManager,
};
Expand Down Expand Up @@ -347,11 +347,11 @@ impl CommandManager {
bail!("could not query proxy state: {}", response.message);
}
ResponseStatus::Ok => {
match response.content {
Some(content) => {
print_query_response_data(cluster_id, domain, content, json)?
}
None => println!("No content in the response"),
if let Some(ResponseContent {
content_type: Some(ContentType::WorkerResponses(worker_responses)),
}) = response.content
{
print_cluster_responses(cluster_id, domain, worker_responses, json)?
}
break;
}
Expand Down

0 comments on commit fcbe244

Please sign in to comment.