tools.echo: adding "echo" tool.

db4
John Benediktsson 2015-04-01 14:51:32 -07:00
parent 197b944c7e
commit 5e1c0580d7
3 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1 @@
John Benediktsson

View File

@ -0,0 +1,15 @@
USING: tools.deploy.config ;
H{
{ deploy-name "echo" }
{ deploy-ui? f }
{ deploy-c-types? f }
{ deploy-console? t }
{ deploy-unicode? f }
{ "stop-after-last-window?" t }
{ deploy-io 3 }
{ deploy-reflection 6 }
{ deploy-word-props? f }
{ deploy-math? t }
{ deploy-threads? t }
{ deploy-word-defs? f }
}

View File

@ -0,0 +1,17 @@
! Copyright (C) 2011 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: command-line io kernel namespaces sequences ;
IN: tools.echo
: -n? ( args -- ? args' )
[ first "-n" = ] keep over [ rest ] when ;
: echo-args ( args -- )
-n? " " join write [ nl ] unless ;
: run-echo ( -- )
command-line get [ nl ] [ echo-args ] if-empty ;
MAIN: run-echo