From 40714ddc779547dcee8d45e983da2429adc156ef Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 26 Sep 2021 22:31:52 +0530 Subject: gnbug: Move issue printing to separate function. * gnbug (print-issue): New function. (gnbug-list): Call print-issue. --- gnbug | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/gnbug b/gnbug index 56249d4..b722b9e 100755 --- a/gnbug +++ b/gnbug @@ -277,6 +277,27 @@ List recent updates. "HEAD") "HEAD"))))) +(define (print-issue issue-number issue) + "Print ISSUE with number ISSUE-NUMBER." + (format #t "~a ~a ~a ~a~a~a~%" + (magenta (string-append "#" (number->string issue-number))) + (issue-created-relative-date issue) + (cyan (issue-creator issue)) + (issue-title issue) + (match (issue-keywords issue) + (() "") + (keywords + (blue + (string-append " [" + (string-join keywords ", ") + "]")))) + (match (issue-assigned issue) + (() "") + (assignees + (magenta (string-append " (assigned: " + (string-join assignees ", ") + ")")))))) + (define gnbug-list (match-lambda* (("--help") @@ -305,24 +326,7 @@ List issues. (issue-assigned issue))))))) (tlog (match-lambda* ((_ (index . issue)) - (format #t "~a ~a ~a ~a~a~a~%" - (magenta (string-append "#" (number->string index))) - (issue-created-relative-date issue) - (cyan (issue-creator issue)) - (issue-title issue) - (match (issue-keywords issue) - (() "") - (keywords - (blue - (string-append " [" - (string-join keywords ", ") - "]")))) - (match (issue-assigned issue) - (() "") - (assignees - (magenta (string-append " (assigned: " - (string-join assignees ", ") - ")"))))))))) + (print-issue index issue))))) rcount (issues))))))) -- cgit v1.2.3