From b71ecd26a9a0822a890f9aa494c6821356ef6bea Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 26 Feb 2012 02:15:43 +0100 Subject: ebus-racket: cli interface --- ebus-racket/dumper.rkt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 ebus-racket/dumper.rkt (limited to 'ebus-racket/dumper.rkt') 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 " + (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)) -- cgit v1.2.1