 
 : start-gopher-server ( directory port -- server )
     <gopher-server> start-server ;
+
+: gopher-server-main ( -- )
+    command-line get ?first "." or
+    70 <gopher-server> start-server wait-for-server ;
+
+MAIN: gopher-server-main

    path [
        [ name>> "." head? ] reject
        [ { [ directory? ] [ regular-file? ] } 1|| ] filter
        [
            [ gopher-type ] [ name>> ] bi
            [
                dup file-info [ file-modified ] [ file-size ] bi
                "%-40s %s %10s" sprintf

! See http://factorcode.org/license.txt for BSD license

USING: accessors calendar combinators combinators.short-circuit
command-line formatting io io.directories io.encodings.binary
io.encodings.string io.encodings.utf8 io.files io.files.info
io.files.types io.pathnames io.servers kernel math mime.types
namespaces sequences sorting splitting strings urls.encoding ;

IN: gopher.server

