aboutsummaryrefslogtreecommitdiff
path: root/module/main.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-06-01 13:11:17 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-06-01 13:34:39 +0200
commit01527c7b52e80541e7f87b589feb950ec833ac76 (patch)
treedf0f89261e2477f40d3b39fffd6eb9592d8be0a7 /module/main.scm
parentAdd number of tags and attributes to ANSI formatter. (diff)
downloadcalp-01527c7b52e80541e7f87b589feb950ec833ac76.tar.gz
calp-01527c7b52e80541e7f87b589feb950ec833ac76.tar.xz
Fix configuration help, print with --help.
Diffstat (limited to 'module/main.scm')
-rw-r--r--module/main.scm24
1 files changed, 13 insertions, 11 deletions
diff --git a/module/main.scm b/module/main.scm
index 7119278e..97657e1c 100644
--- a/module/main.scm
+++ b/module/main.scm
@@ -37,17 +37,16 @@
(define options
'((statprof (value display-style)
- (description (*TOP* "Run the program within Guile's built in statical"
+ (description (*TOP* "Run the program within Guile's built in statical "
"profiler. Display style is one of "
- (b "flat") " and " (b "tree") ".")))
+ (b "flat") " or " (b "tree") ".")))
(repl (value address)
(description
(*TOP* "Start a Guile repl which can be connected to, defaults to the unix socket "
(i "/run/user/${UID}/calp-${PID}") ", but it can be bound to any unix or "
"TCP socket. ((@ (util app) current-app)) should return the current app context."
(br)
- (b "Should NOT be used in production.")))
- )
+ (b "Should NOT be used in production."))))
(help (single-char #\h)
(description "Print this help"))))
@@ -92,13 +91,6 @@
(define stprof (option-ref opts 'statprof #f))
(define repl (option-ref opts 'repl #f))
- (awhen (option-ref opts 'help #f)
- (display (sxml->ansi-text module-help)
- (current-output-port))
- (print-arg-help options)
- (throw 'return)
- )
-
(when stprof (statprof-start))
(cond [(eqv? #t repl) (repl-start (format #f "~a/calp-~a" (runtime-dir) (getpid)))]
@@ -110,6 +102,16 @@
(primitive-load config-file)))
+ ;; help printing moved below some other stuff to allow
+ ;; print-configuration-and-return to show bound values.
+ (awhen (option-ref opts 'help #f)
+ (display (sxml->ansi-text module-help)
+ (current-output-port))
+ (print-arg-help options)
+ (display (sxml->ansi-text (get-configuration-documentation))
+ (current-output-port))
+ (throw 'return)
+ )
;; (current-app (make-app))
((@ (vcomponent) init-app) (get-config 'calendar-files))