From fc6c67004ec5b0a224e8042b7f74f78ae0e66e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Mon, 27 Mar 2023 17:39:41 +0200 Subject: [PATCH] Get all files with problems. --- bbstool.scm | 8 ++++++++ member-record.scm | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/bbstool.scm b/bbstool.scm index 2046c3a..aca3c99 100644 --- a/bbstool.scm +++ b/bbstool.scm @@ -88,6 +88,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. (-gencards (file:cards file:desfires) "Generates brmdoor-compatible card files" (-action- 'gencards) (-fname- (list file:cards file:desfires))) + (-problems () "Prints all files with problems" (-action- 'problems)) ) ;; Run tests @@ -157,4 +158,11 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. (newline)) ((gencards) (apply cards-export MB (-fname-))) + ((problems) + (let loop ((mb MB)) + (when (not (null? mb)) + (when (member-highlights? (car mb)) + (newline) + (print-member-source (car mb))) + (loop (cdr mb))))) ) diff --git a/member-record.scm b/member-record.scm index 074adbf..92bcb87 100644 --- a/member-record.scm +++ b/member-record.scm @@ -43,6 +43,7 @@ member-record-info member-missing-keys + member-highlights? member-destroyed? member-suspended? @@ -194,6 +195,10 @@ (if v acc (cons k acc))) (dict-ref mr 'info))) + ;; True if there are any source highlights + (define (member-highlights? mr) + (dict-has-key? mr 'highlights)) + ;; Returns true if the member record represents destroyed member. The ;; *current-month* is a global parameter from period module. (define (member-destroyed? mr)