Просмотр исходного кода

tau: Sort tasks by id when printing them.

parazyd 3 лет назад
Родитель
Сommit
804494b4ba
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      bin/tau/tau-cli/src/main.rs

+ 3 - 0
bin/tau/tau-cli/src/main.rs

@@ -186,10 +186,13 @@ async fn main() -> Result<()> {
         } else {
         } else {
             vec![]
             vec![]
         };
         };
+
     for id in task_ids {
     for id in task_ids {
         tasks.push(tau.get_task_by_id(id).await?);
         tasks.push(tau.get_task_by_id(id).await?);
     }
     }
 
 
+    tasks.sort_by(|a, b| a.id.partial_cmp(&b.id).unwrap());
+
     if ids_clone.len() == 1 && args.command.is_none() {
     if ids_clone.len() == 1 && args.command.is_none() {
         let tsk = tasks[0].clone();
         let tsk = tasks[0].clone();
         print_task_info(tsk)?;
         print_task_info(tsk)?;