diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-30 17:29:39 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-30 17:29:39 +0100 |
commit | 486ed5838bb3258b4bd1cb1d87534b048cecc8e2 (patch) | |
tree | 785e94da9611c8fa1b6613fc552fac78a8ab00cf | |
parent | Option handling. (diff) | |
download | rss-filter-486ed5838bb3258b4bd1cb1d87534b048cecc8e2.tar.gz rss-filter-486ed5838bb3258b4bd1cb1d87534b048cecc8e2.tar.xz |
Improve --help output.
Diffstat (limited to '')
-rwxr-xr-x | main.scm | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -64,24 +64,25 @@ (define option-spec `((output (single-char #\o) (required? #f) - (value #t)) - (help (single-char #\h)) + (value #t) + (description "Target directory for output files" (br) + "Defaults to " (i "$PWD") ".")) + (help (single-char #\h) + (description "Print this help")) (config-dir (required? #f) - (value #t)) - (quiet (value #f)))) + (value #t) + (description "Defaults to " (i "$XDG_CONFIG_DIR/rss-filter"))) + (quiet (value #f) + (description "Supress info output")))) -(define (display-help) - (format #t "Usage: ~a [--config-dir conf-dir] [--output /tmp/output]~%" - (car (command-line)))) - (define (display-no-config config-dir) (format #t "Configuration directory [~a] doesn't exist, or is unreadable~%" config-dir)) (define (main args) - (define opts (getopt-long args option-spec)) + (define opts (getopt-long args ((@ (calp util options) getopt-opt) option-spec))) (define output-directory (option-ref opts 'output ".")) (define config-dir @@ -92,7 +93,7 @@ (define quiet? (option-ref opts 'quiet #f)) (when (option-ref opts 'help #f) - (display-help) + ((@ (calp util options) print-arg-help) option-spec) (exit 0)) (unless (file-exists? config-dir) |