--:Minify:--
local args={...}
if type(args[1])~="string" then print("Usage: wget [url]"); syscall.exit() end
local http = require("http")
local fs = require("fs")
print("GET: "..args[1])
local resp = http.get(args[1])
local clean_url = args[1]:match("^([^?#]+)")
local filename = clean_url:match("^.+/(.+)$")
fs.writeAllText(filename, resp.body)