summary refs log tree commit diff
path: root/gnbug
diff options
context:
space:
mode:
authorArun Isaac2021-09-26 22:31:52 +0530
committerArun Isaac2021-09-26 22:31:52 +0530
commit40714ddc779547dcee8d45e983da2429adc156ef (patch)
tree3f7f3837da04f1d3dc11aaac5953c56fa9166794 /gnbug
parent2580763fcc905afb392791ef9c592f3ae418d1b0 (diff)
downloadgn-gemtext-40714ddc779547dcee8d45e983da2429adc156ef.tar.gz
gnbug: Move issue printing to separate function.
* gnbug (print-issue): New function.
(gnbug-list): Call print-issue.
Diffstat (limited to 'gnbug')
-rwxr-xr-xgnbug40
1 files 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)))))))