+let print_task dbh taskid ?rhbz ?deadline ?estimate description =
+ let cols = ref 0 in
+ printf " •";
+ cols := !cols + 3;
+
+ (match deadline with
+ | None -> ()
+ | Some deadline ->
+ let deadline =
+ if Time.equal (Time.midnight ()) (Calendar.to_time deadline) then
+ Printer.Calendar.sprint "%F" deadline
+ else
+ Printer.Calendar.to_string deadline in
+ let deadline = " " ^ deadline in
+ printf "%s" deadline;
+ cols := !cols + String.length deadline
+ );
+
+ (match estimate with
+ | None -> ()
+ | Some period ->
+ let estimate = " " ^ string_of_estimate period in
+ printf "%s" estimate;
+ cols := !cols + String.length estimate
+ );
+
+ (match rhbz with
+ | None -> ()
+ | Some rhbz ->
+ printf " https://bugzilla.redhat.com/%ld\n " rhbz;
+ cols := 3
+ );
+
+ printf " %s" (string_of_task_desc description);
+ cols := !cols + String.length description + 1;
+
+ let taskid_len = String.length (sprintf "#%ld" taskid) in
+ if !cols + taskid_len >= 78 then (
+ printf "\n ";
+ cols := 3
+ );
+ printf " %s" (string_of_taskid taskid);
+ cols := !cols + taskid_len + 1;
+