]> gitweb.factorcode.org Git - factor.git/commitdiff
gemini.cli: use stdin for input, not argument
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 15 Jan 2023 00:06:23 +0000 (16:06 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 15 Jan 2023 00:06:23 +0000 (16:06 -0800)
extra/gemini/cli/cli.factor

index 62244ae5eabb1292ce352644f0d1493eb5e37c7d..7c1ebc846506a1fcfeb223dceeae42906a9a2569 100644 (file)
@@ -124,8 +124,12 @@ CONSTANT: URL V{ }
 
 : gemini-less ( -- )
     "gemini.txt" temp-file dup file-exists? [
-        [ "PAGER" os-env [ "less" ] unless* ]
-        [ "\"" dup surround " " glue try-process ] bi*
+        utf8 [
+            <process>
+                "PAGER" os-env [ "less" ] unless* >>command
+                input-stream get >>stdin
+            try-process
+        ] with-file-reader
     ] [ drop ] if ;
 
  : gemini-ls ( args -- )