From: John Benediktsson Date: Wed, 1 Apr 2015 21:51:32 +0000 (-0700) Subject: tools.echo: adding "echo" tool. X-Git-Tag: unmaintained~2912 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=5e1c0580d76195067f9a34ce794b0a92885b3a94 tools.echo: adding "echo" tool. --- diff --git a/extra/tools/echo/authors.txt b/extra/tools/echo/authors.txt new file mode 100644 index 0000000000..e091bb8164 --- /dev/null +++ b/extra/tools/echo/authors.txt @@ -0,0 +1 @@ +John Benediktsson diff --git a/extra/tools/echo/deploy.factor b/extra/tools/echo/deploy.factor new file mode 100644 index 0000000000..e79c594303 --- /dev/null +++ b/extra/tools/echo/deploy.factor @@ -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 } +} diff --git a/extra/tools/echo/echo.factor b/extra/tools/echo/echo.factor new file mode 100644 index 0000000000..0fcf9db16b --- /dev/null +++ b/extra/tools/echo/echo.factor @@ -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