File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 31
31
;; http://docs.racket-lang.org/style/index.html
32
32
33
33
;; Code here
34
- (require racket/cmdline)
34
+ (require racket/cmdline racket/port )
35
35
(define who (box "world " ))
36
+ (define (pipediput)
37
+ (for ([line (port->lines)])
38
+ (printf "hello ~a~n " line)))
36
39
(command-line
37
- #:program "my-program "
38
- #:once-each
40
+ #:program "Greeter "
41
+ #:once-any
39
42
[("-n " "--name " ) name "Who to say hello to " (set-box! who name)]
43
+ [("-p " "--pipe " ) "greet piped list " (pipediput)]
40
44
#:args ()
41
45
(printf "hello ~a~n " (unbox who)))
42
46
Original file line number Diff line number Diff line change
1
+ Orlando
2
+ Jack
3
+ Sorawee
4
+ Laurent
5
+ Jens
Original file line number Diff line number Diff line change
1
+ cat names.txt | ./hello -p
2
+ ./hello -n Sam
You can’t perform that action at this time.
0 commit comments