backticks: adding backtick syntax experiment.

db4
John Benediktsson 2015-04-17 17:40:12 -07:00
parent 12f87c2678
commit 24de8af6e5
4 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1 @@
John Benediktsson

View File

@ -0,0 +1,12 @@
USING: help.markup help.syntax io.encodings.utf8 strings ;
IN: backticks
HELP: `
{ $syntax "` command [args]`" }
{ $description "Runs the specified command and captures the output as a " { $link utf8 } " encoded " { $link string } "." }
{ $examples
{ $unchecked-example
"` ls -l`"
"total 45\ndrwxrwxr-x+ 61 root admin 2074 Apr 8 22:58 Applic..."
}
} ;

View File

@ -0,0 +1,10 @@
! Copyright (C) 2015 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: fry io io.encodings.utf8 io.launcher multiline sequences
unicode.categories ;
IN: backticks
SYNTAX: `
"`" parse-multiline-string [ blank? ] trim
'[ _ utf8 [ contents ] with-process-reader ]
append! ;

View File

@ -0,0 +1 @@
Backtick process syntax