Skip to content
Snippets Groups Projects
Commit f5ee5bb9 authored by art's avatar art
Browse files

Support for second optional argument, specifying output file. Use backslash()...

Support for second optional argument, specifying output file. Use backslash() for filename. More one-trick-ponies.
parent 43096513
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,18 @@
load("http.js");
var url = argv[0];
var filename=js.startup_dir + '/' + file_getname(url);
var url = argv[0]; // First argument is the URL (required).
var outfile; // Pass a second argument as the outfile (optional).
var filename=backslash(js.startup_dir);
if (argv[1]) {
outfile = argv[1];
filename += outfile;
} else {
filename += file_getname(url);
}
print("Writing to file: " + filename);
var file = new File(filename);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment