From b8f7dd4d626eb1cda8de1afcd5d2ffcce3463ade Mon Sep 17 00:00:00 2001 From: crc Date: Fri, 17 Nov 2017 21:01:51 +0000 Subject: [PATCH] editor: add "new " to command line as option FossilOrigin-Name: 515e25b3cd9937a3c7e4e1185b0d32ba9f5797fbd2686ac05908f9ef7d0c23c6 --- example/edit.forth | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example/edit.forth b/example/edit.forth index 97cb24e..05c6c27 100755 --- a/example/edit.forth +++ b/example/edit.forth @@ -33,6 +33,9 @@ Get the name of the file to edit. If no file is provided, exit. ~~~ sys:argc n:zero? [ #0 unix:exit ] if #0 sys:argv s:keep !SourceFile +@SourceFile 'new s:eq? + [ #1 sys:argv s:keep !SourceFile + @SourceFile file:A file:open file:close ] if ~~~ This is just a shortcut to make writing strings to the current file