X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=sam.git;a=blobdiff_plain;f=chat_client.scm;h=d50057992ec5df9432d78dbcc8dc59540c881a0a;hp=947418f09d7be452767bcedfa7c9487469aa00c3;hb=5d2d076345efb45ced333e832d1cbf766bcd5e8a;hpb=3001c497e5536bb767303d96a6b65e2ad040e754 diff --git a/chat_client.scm b/chat_client.scm index 947418f..d500579 100644 --- a/chat_client.scm +++ b/chat_client.scm @@ -1,5 +1,4 @@ -(import sam - matchable +(import matchable srfi-13 (chicken process-context)) @@ -69,25 +68,3 @@ (define (main-beh self system) (send-message (make-actor (make-client-beh system)) 'start) 'done) - -(define (print-usage) - (print "Actor-driven chat client.\n") - (print "Usage: chat_client -h") - (print " chat_client [-p port_num] [-n host_name]")) - -(let loop ((args (cdr (argv))) - (host "localhost") - (port 8000)) - (match args - (((or "-h" "--help")) - (print-usage)) - (((or "-p" "--port") pstr rest ...) - (loop rest host (string->number pstr))) - (((or "-n" "--hostname") hstr rest ...) - (loop rest hstr port)) - (() - (boot-sam host port main-beh)) - (else - (print "Unrecognised argument '" (car args) "'.\n") - (print-usage)))) -