webbrowser: adding MAIN.

master
John Benediktsson 2020-05-20 20:26:02 -07:00
parent 15b0f07b37
commit 551e079da8
1 changed files with 7 additions and 2 deletions

View File

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