]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.echo: adding "echo" tool.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 1 Apr 2015 21:51:32 +0000 (14:51 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 1 Apr 2015 21:51:32 +0000 (14:51 -0700)
extra/tools/echo/authors.txt [new file with mode: 0644]
extra/tools/echo/deploy.factor [new file with mode: 0644]
extra/tools/echo/echo.factor [new file with mode: 0644]

diff --git a/extra/tools/echo/authors.txt b/extra/tools/echo/authors.txt
new file mode 100644 (file)
index 0000000..e091bb8
--- /dev/null
@@ -0,0 +1 @@
+John Benediktsson
diff --git a/extra/tools/echo/deploy.factor b/extra/tools/echo/deploy.factor
new file mode 100644 (file)
index 0000000..e79c594
--- /dev/null
@@ -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 (file)
index 0000000..0fcf9db
--- /dev/null
@@ -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