diff options
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 |