 
 : version? ( -- ? ) "version" get ;
 
+: listener-restarts ( quot -- )
+    [
+        restarts get empty? embedded? or
+        [ rethrow ] [ print-error-and-restarts "q" on "listener" run ] if
+    ] recover ; inline
+
 : command-line-startup ( -- )
     (command-line) parse-command-line {
         { [ help? ] [ help. ] }

! Copyright (C) 2011 Joe Groff.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators command-line eval io io.pathnames kernel
layouts math math.parser namespaces parser system vocabs.loader ;
IN: command-line.startup

: help? ( -- ? )

        -run=listener   run terminal listener
        -run=ui.tools   run Factor development UI
    -e=<code>           evaluate <code>
    -no-user-init       suppress loading of .factor-rc
    -datastack=<int>    datastack size in KiB [" write cell 32 * number>string write "]
    -retainstack=<int>  retainstack size in KiB [" write cell 32 * number>string write "]
