summaryrefslogtreecommitdiff
path: root/ebus-racket/dumper.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'ebus-racket/dumper.rkt')
-rwxr-xr-xebus-racket/dumper.rkt27
1 files changed, 27 insertions, 0 deletions
diff --git a/ebus-racket/dumper.rkt b/ebus-racket/dumper.rkt
new file mode 100755
index 0000000..7ac1da6
--- /dev/null
+++ b/ebus-racket/dumper.rkt
@@ -0,0 +1,27 @@
+#! /usr/bin/env racket
+#lang racket
+
+(require "parser.ss")
+
+;(define verbose? (make-parameter #f))
+(define connect-host? (make-parameter null))
+(define connect-port? (make-parameter null))
+
+(define greeting
+ (command-line
+ #:once-each
+; [("-v") "Verbose mode" (verbose? #t)]
+ [("-c" "--connect") host port
+ "Connect to server <host> <port>"
+ (connect-host? host)
+ (connect-port? (string->number port))
+ ]))
+; Connect
+(if (or (null? (connect-host?)) (null? (connect-port?)))
+ (display "Using stdin")
+ (let-values ([(cin cout) (tcp-connect (connect-host?) (connect-port?))])
+ (display (format "Connected to ~s ~s ~n" (connect-host?) (connect-port?)))
+ (current-input-port cin)))
+
+;
+(read-ebus-loop (current-input-port))