diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d319acea..ae4cc54a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Dev ## Breaking change + * The output format of the `job info` command with JSON output mode has been changed. Note that the JSON output mode is still unstable. diff --git a/crates/hyperqueue/src/client/commands/job.rs b/crates/hyperqueue/src/client/commands/job.rs index df48c1eaf..77246334e 100644 --- a/crates/hyperqueue/src/client/commands/job.rs +++ b/crates/hyperqueue/src/client/commands/job.rs @@ -8,13 +8,12 @@ use crate::client::status::{job_status, Status}; use crate::common::cli::{parse_last_all_range, parse_last_range, TaskSelectorArg}; use crate::common::utils::str::pluralize; use crate::rpc_call; -use crate::transfer::connection::{ClientConnection, ClientSession}; +use crate::transfer::connection::ClientSession; use crate::transfer::messages::{ CancelJobResponse, CancelRequest, ForgetJobRequest, FromClientMessage, IdSelector, JobDetail, JobDetailRequest, JobInfoRequest, TaskIdSelector, TaskSelector, TaskStatusSelector, ToClientMessage, }; -use crate::JobId; #[derive(Parser)] pub struct JobListOpts { @@ -107,28 +106,6 @@ pub struct JobCatOpts { pub stream: OutputStream, } -pub async fn get_last_job_id(connection: &mut ClientConnection) -> crate::Result> { - let message = FromClientMessage::JobInfo(JobInfoRequest { - selector: IdSelector::LastN(1), - }); - let response = rpc_call!(connection, message, ToClientMessage::JobInfoResponse(r) => r).await?; - - Ok(response.jobs.last().map(|job| job.id)) -} - -pub async fn get_job_ids(connection: &mut ClientConnection) -> crate::Result>> { - let message = FromClientMessage::JobInfo(JobInfoRequest { - selector: IdSelector::All, - }); - let response = rpc_call!(connection, message, ToClientMessage::JobInfoResponse(r) => r).await?; - - let mut ids: Vec = Vec::new(); - for job in response.jobs { - ids.push(job.id); - } - Ok(Option::from(ids)) -} - pub async fn output_job_list( gsettings: &GlobalSettings, session: &mut ClientSession,