Finish stdout util and bump dev version.

This commit is contained in:
Dominik Pantůček 2023-05-10 20:21:41 +02:00
parent 7a19204242
commit 5fed8899a4
4 changed files with 14 additions and 8 deletions

View file

@ -38,7 +38,8 @@ HACKERBASE-DEPS=hackerbase.scm cal-month.import.scm \
web-static.import.scm environment.import.scm \ web-static.import.scm environment.import.scm \
mailman.import.scm texts.import.scm tests.import.scm \ mailman.import.scm texts.import.scm tests.import.scm \
notifications.import.scm logging.import.scm \ notifications.import.scm logging.import.scm \
progress.import.scm cal-period.import.scm progress.import.scm cal-period.import.scm \
util-stdout.import.scm
HACKERBASE-OBJS=hackerbase.o testing.o listing.o cal-month.o \ HACKERBASE-OBJS=hackerbase.o testing.o listing.o cal-month.o \
cal-period.o ansi.o util-dict-list.o command-line.o mbase.o \ cal-period.o ansi.o util-dict-list.o command-line.o mbase.o \

View file

@ -43,7 +43,8 @@
cal-period cal-period
cal-month cal-month
util-git util-git
util-dict-list) util-dict-list
util-stdout)
;; Command-line options and configurable parameters ;; Command-line options and configurable parameters
(define -needs-bank- (make-parameter #f)) (define -needs-bank- (make-parameter #f))
@ -58,7 +59,6 @@
(define -show-destroyed- (make-parameter #f)) (define -show-destroyed- (make-parameter #f))
(define -notify-months- (make-parameter 1)) (define -notify-months- (make-parameter 1))
(define -send-emails- (make-parameter #f)) (define -send-emails- (make-parameter #f))
(define -quiet- (make-parameter #f))
;; Arguments parsing ;; Arguments parsing
(command-line (command-line
@ -104,7 +104,7 @@
(-logfile (filename) "Enable logging to file" (-logfile (filename) "Enable logging to file"
(*log-file* filename)) (*log-file* filename))
(-quiet () "Suppress all output" (-quiet () "Suppress all output"
(-quiet- #t) (*stdout-quiet* #t)
(*progress-quiet* #t)) (*progress-quiet* #t))
(-from (email) "Sender email address" (-from (email) "Sender email address"
(*email-from* email)) (*email-from* email))
@ -167,9 +167,8 @@
) )
;; Print banner ;; Print banner
(when (not (-quiet-)) (stdout-print banner-line)
(print banner-line) (stdout-newline)
(newline))
;; Load default configuration ;; Load default configuration
(load-configuration!) (load-configuration!)

View file

@ -39,7 +39,7 @@
(chicken format)) (chicken format))
;; Short banner ;; Short banner
(define banner-line "HackerBase 1.0 (c) 2023 Brmlab, z.s.") (define banner-line "HackerBase 1.0.99-dev (c) 2023 Brmlab, z.s.")
;; Banner source with numbers for ANSI CSI SGR ;; Banner source with numbers for ANSI CSI SGR
(define banner-source " (define banner-source "

View file

@ -31,6 +31,7 @@
*stdout-quiet* *stdout-quiet*
stdout-print stdout-print
stdout-printf stdout-printf
stdout-newline
) )
(import scheme (import scheme
@ -50,4 +51,9 @@
(when (not (*stdout-quiet*)) (when (not (*stdout-quiet*))
(print (apply format fmt args)))) (print (apply format fmt args))))
;; Prints newline if not quiet
(define (stdout-newline)
(when (not (*stdout-quiet*))
(newline)))
) )