aboutsummaryrefslogtreecommitdiff
path: root/module/entry-points/benchmark.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-06-01 13:58:21 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-06-01 13:58:21 +0200
commitfce0a555f50737daf31ba2d3385bf9ab5f9b0c4a (patch)
tree41bbe7bbf0b171adf607d4d8803a9a9d4b77dbd7 /module/entry-points/benchmark.scm
parentAdd debug config to html. (diff)
downloadcalp-fce0a555f50737daf31ba2d3385bf9ab5f9b0c4a.tar.gz
calp-fce0a555f50737daf31ba2d3385bf9ab5f9b0c4a.tar.xz
Extend and document benchmark main.
Diffstat (limited to 'module/entry-points/benchmark.scm')
-rw-r--r--module/entry-points/benchmark.scm30
1 files changed, 26 insertions, 4 deletions
diff --git a/module/entry-points/benchmark.scm b/module/entry-points/benchmark.scm
index 701d786b..0ff5556d 100644
--- a/module/entry-points/benchmark.scm
+++ b/module/entry-points/benchmark.scm
@@ -2,16 +2,38 @@
:export (main)
:use-module (ice-9 getopt-long)
+ :use-module (util options)
:use-module (util)
:use-module (util app)
)
(define opt-spec
- '())
+ `((field (value #t)
+ (description
+ (*TOP*
+ "Which field from the current app to force. Most heavy fields are defined in "
+ (i "(vcomponent)") ".")))
+ (enable-output (single-char #\o)
+ (description
+ (*TOP*
+ "Output is be default supressed, since many fields contain way to much data "
+ "to read. This turns it on again.")))
+ (help (single-char #\h) (description "Print this help."))))
+
(define (main args)
- (define opts (getopt-long args opt-spec))
+ (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."))
- (write (getf 'calendars app: (current-app)))
-)
+ (aif (option-ref opts 'enable-output #f)
+ (write (getf field app: (current-app)))
+ (getf field app: (current-app))))