diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-08-22 16:11:59 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-08-22 16:11:59 +0200 |
commit | bd00e07648d0941cee7f5a95b72d413908e9634e (patch) | |
tree | 7ffc8df70b0cd51e41098e1b0cfeb4d2be442680 /main.scm | |
parent | Initial commit. (diff) | |
download | rss-filter-bd00e07648d0941cee7f5a95b72d413908e9634e.tar.gz rss-filter-bd00e07648d0941cee7f5a95b72d413908e9634e.tar.xz |
Add --output option.
Diffstat (limited to 'main.scm')
-rwxr-xr-x | main.scm | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -9,6 +9,7 @@ (sxml xpath) (sxml transform) (ice-9 regex) + (ice-9 getopt-long) ) @@ -39,8 +40,15 @@ (*default* . ,(lambda (item . children) (cons item children))))) ) +(define option-spec + `((output (single-char #\o) + (required? #t) + (value #t)))) + (define (main args) + (define opts (getopt-long args option-spec)) + (define response (http-get "https://lwn.net/headlines/Features" #:streaming? #t)) @@ -50,7 +58,7 @@ (response-code response)) (exit 1)) - (with-output-to-file "lwn-unlocked-features.xml" + (with-output-to-file (option-ref opts 'output #f) (lambda () (sxml->xml (filter-tree |