From: Raghu R Date: Tue, 9 Aug 2022 15:52:43 +0000 (+0530) Subject: add mention of run-file to scripting cookbook X-Git-Tag: 0.99~1155 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=08e1de1d5afffa5ceeac08549abb3a5debbbe7a4 add mention of run-file to scripting cookbook --- diff --git a/basis/help/cookbook/cookbook.factor b/basis/help/cookbook/cookbook.factor index b6e3c74a44..e4b753a961 100644 --- a/basis/help/cookbook/cookbook.factor +++ b/basis/help/cookbook/cookbook.factor @@ -190,6 +190,8 @@ ARTICLE: "cookbook-scripts" "Scripting cookbook" $nl "To run a script, simply pass it as an argument to the Factor executable:" { $code "./factor cleanup.factor" } +"To test a script in the listener, you can use " { $link run-file } "." +$nl "The script may access command line arguments by inspecting the value of the " { $link command-line } " variable. It can also get its own path from the " { $link script } " variable." { $heading "Example: ls" } "Here is an example implementing a simplified version of the Unix " { $snippet "ls" } " command in Factor:"