! Copyright (C) 2014 John Benediktsson ! See https://factorcode.org/license.txt for BSD license USING: alien.destructors command-line curl.ffi destructors http.download io.backend io.streams.c kernel namespaces present sequences ; IN: curl : curl-download-as ( url path -- ) [ curl-init [ swap curl-set-file ] [ swap curl-set-url ] [ curl-perform ] tri ] with-destructors ; : curl-download ( url -- path ) dup download-name [ curl-download-as ] keep ; : curl-main ( -- ) command-line get [ curl-init [ swap curl-set-url ] [ curl-perform ] bi ] each ; MAIN: curl-main