Skip to content
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
8 changes: 4 additions & 4 deletions crates/pu-cli/src/commands/agent_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub async fn run_list(socket: &Path, json: bool) -> Result<(), CliError> {
let project_root = commands::cwd_string()?;
let resp = client::send_request(socket, &Request::ListAgentDefs { project_root }).await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand Down Expand Up @@ -60,7 +60,7 @@ pub async fn run_create(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand All @@ -76,7 +76,7 @@ pub async fn run_show(socket: &Path, name: &str, json: bool) -> Result<(), CliEr
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand All @@ -98,7 +98,7 @@ pub async fn run_delete(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion crates/pu-cli/src/commands/attach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ pub async fn run(socket: &Path, agent_id: &str) -> Result<(), CliError> {
)
.await?;
let resp = output::check_response(resp, false)?;
output::print_response(&resp, false);
output::print_response(&resp, false)?;
Ok(())
}
4 changes: 2 additions & 2 deletions crates/pu-cli/src/commands/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub async fn run(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
}
} else if let Some(wt_id) = worktree {
let resp = client::send_request(
Expand All @@ -70,7 +70,7 @@ pub async fn run(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion crates/pu-cli/src/commands/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ pub async fn run(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}
6 changes: 1 addition & 5 deletions crates/pu-cli/src/commands/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ pub async fn run(socket: &Path, action: GridAction) -> Result<(), CliError> {
match resp {
Response::GridLayout { layout } => {
if json {
println!(
"{}",
serde_json::to_string_pretty(&layout)
.expect("layout JSON serialization failed")
);
println!("{}", serde_json::to_string_pretty(&layout)?);
} else {
print_ascii_grid(&layout);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/pu-cli/src/commands/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ pub async fn run(socket: &Path, json: bool) -> Result<(), CliError> {

let resp = client::send_request(socket, &Request::Health).await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}
2 changes: 1 addition & 1 deletion crates/pu-cli/src/commands/kill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ pub async fn run(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}
2 changes: 1 addition & 1 deletion crates/pu-cli/src/commands/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ pub async fn run(socket: &Path, agent_id: &str, tail: usize, json: bool) -> Resu
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}
13 changes: 5 additions & 8 deletions crates/pu-cli/src/commands/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub async fn run_list(socket: &Path, json: bool) -> Result<(), CliError> {
let project_root = commands::cwd_string()?;
let resp = client::send_request(socket, &Request::ListTemplates { project_root }).await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
return Ok(());
}

Expand All @@ -29,10 +29,7 @@ fn run_list_local(json: bool) -> Result<(), CliError> {
let templates = template::list_templates(&cwd);

if json {
println!(
"{}",
serde_json::to_string_pretty(&templates).expect("templates JSON serialization failed")
);
println!("{}", serde_json::to_string_pretty(&templates)?);
return Ok(());
}

Expand Down Expand Up @@ -73,7 +70,7 @@ pub async fn run_show(socket: &Path, name: &str, json: bool) -> Result<(), CliEr
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand Down Expand Up @@ -102,7 +99,7 @@ pub async fn run_create(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand All @@ -124,6 +121,6 @@ pub async fn run_delete(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}
12 changes: 6 additions & 6 deletions crates/pu-cli/src/commands/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub async fn run_list(socket: &Path, json: bool) -> Result<(), CliError> {
let project_root = commands::cwd_string()?;
let resp = client::send_request(socket, &Request::ListSchedules { project_root }).await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand Down Expand Up @@ -97,7 +97,7 @@ pub async fn run_create(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand All @@ -113,7 +113,7 @@ pub async fn run_show(socket: &Path, name: &str, json: bool) -> Result<(), CliEr
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand All @@ -135,7 +135,7 @@ pub async fn run_delete(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand All @@ -151,7 +151,7 @@ pub async fn run_enable(socket: &Path, name: &str, json: bool) -> Result<(), Cli
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand All @@ -167,7 +167,7 @@ pub async fn run_disable(socket: &Path, name: &str, json: bool) -> Result<(), Cl
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion crates/pu-cli/src/commands/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub async fn run(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion crates/pu-cli/src/commands/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ pub async fn run(socket: &Path, agent: Option<String>, json: bool) -> Result<(),
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}
10 changes: 5 additions & 5 deletions crates/pu-cli/src/commands/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub async fn run_list(socket: &Path, json: bool) -> Result<(), CliError> {
let project_root = commands::cwd_string()?;
let resp = client::send_request(socket, &Request::ListSwarmDefs { project_root }).await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand Down Expand Up @@ -44,7 +44,7 @@ pub async fn run_create(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand Down Expand Up @@ -87,7 +87,7 @@ pub async fn run_show(socket: &Path, name: &str, json: bool) -> Result<(), CliEr
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand All @@ -109,7 +109,7 @@ pub async fn run_delete(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand All @@ -132,7 +132,7 @@ pub async fn run_run(
)
.await?;
let resp = output::check_response(resp, json)?;
output::print_response(&resp, json);
output::print_response(&resp, json)?;
Ok(())
}

Expand Down
Loading
Loading