From b9c7203a641ca40a742555babc059cce912e6ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 14 Aug 2020 16:06:48 +0200 Subject: Improve makefile. --- module/entry-points/benchmark.scm | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'module') diff --git a/module/entry-points/benchmark.scm b/module/entry-points/benchmark.scm index a8507fb9..fecc62f7 100644 --- a/module/entry-points/benchmark.scm +++ b/module/entry-points/benchmark.scm @@ -1,19 +1,19 @@ (define-module (entry-points benchmark) - :export (main) + :use-module (util) :use-module (ice-9 getopt-long) :use-module (util options) - :use-module (util) - :use-module (srfi srfi-41) + :use-module ((srfi srfi-41) :select (stream->list)) + + :use-module ((vcomponent instance methods) :select (get-event-set)) + :autoload (vcomponent instance) (global-event-object) + + :export (main) ) (define opt-spec - `((field (value #t) - (description - "Which field from the current app to force. Most heavy fields are defined in " - (i "(vcomponent)") ". Required.")) - (enable-output (single-char #\o) + `((enable-output (single-char #\o) (description "Output is be default supressed, since many fields contain way to much data " "to read. This turns it on again.")) @@ -23,17 +23,11 @@ (define (main args) (define opts (getopt-long args (getopt-opt opt-spec))) - (define field (and=> (option-ref opts 'field #f) string->symbol)) - (when (option-ref opts 'help #f) (print-arg-help opt-spec) (throw 'return)) - (unless field - (throw 'argument-error "Field `field' required.")) - - (let ((strm ((@ (vcomponent instance) get-event-set) - (@ (vcomponent instance) global-event-object)))) + (let ((strm (get-event-set global-event-object))) (if (option-ref opts 'enable-output #f) (write (stream->list 1000 strm)) (stream->list 1000 strm)))) -- cgit v1.2.3