]> gitweb.factorcode.org Git - factor.git/commitdiff
webbrowser: adding MAIN.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 21 May 2020 03:26:02 +0000 (20:26 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 21 May 2020 03:26:02 +0000 (20:26 -0700)
basis/webbrowser/webbrowser.factor

index a712fb1f5a2c4a810a8c7f4d6de45e1e0916ed84..9b6986d7107f95a2b633bc096d1b52391ca43fb6 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2011 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
-USING: accessors io.pathnames kernel sequences strings system
-ui.operations urls vocabs ;
+USING: accessors command-line io.pathnames kernel namespaces
+sequences strings system ui.operations urls vocabs ;
 IN: webbrowser
 
 HOOK: open-item os ( item -- )
@@ -15,3 +15,8 @@ PREDICATE: url-string < string >url protocol>> >boolean ;
 
 [ pathname? ] \ open-item H{ } define-operation
 [ [ url? ] [ url-string? ] bi or ] \ open-url H{ } define-operation
+
+: webbrowser-main ( -- )
+    command-line get [ open-url ] each ;
+
+MAIN: webbrowser-main