If the second argument is omitted, hxcopy writes to standard output. In this case the option -o is required. If the first argument is also omitted, hxcopy reads from standard input. In this case the option -i is required.
10 -i " old-URL" For the purposes of updating relative links, act as if old-URL is the location from which the input is copied. If this option is omitted, the actual location of the first argument is used for calculating relative links.
-o " new-URL" For the purposed of updating relative links, act as if new-URL is the location to which the input is copied. If this option is omitted, the actual location of the second argument is used for calculating relative links.
-s Also replace links to self. This effects the treatment of empty URLs, i.e., links to the document itself that do not explicitly name the document. Without -s "," implicit links to the document itself (href=""), to a fragment of the document itself (href="#foo") or to a query over the document itself (href="?query") are not changed and will thus refer to (a fragment of) the new document. With -s "," these links are rewritten to refer to (a fragment of) the old document instead.
-v Print the version number and exit immediately.
The second argument must be a local file. Writing to a URL is not yet implemented. To work around this, replace "hxcopy file.html http://example.org/file.html" by "hxcopy -o http://example.org/file.html file.html tmp.html" and then upload tmp.html to the given URL with some other command, such as curl (1). The first argument, however, may be a URL. hxcopy will download the given file. (Currently only HTTP is supported.)
"hxcopy foo.html bar/foo.html" The file foo.html is copied to ../bar/foo.html and the relative link to "../bar.html" becomes "../../bar.html".
"hxcopy foo.html ../foo.html" The file foo.html is copied to ../foo.html and the relative link to "../bar.html" is rewritten as "bar.html".
"hxcopy -i http://my.org/dir1/foo.html -o http://my.org/foo.html file1.html file2.html" The file file1.html is copied to file2.html and the relative link to "../bar.html" is rewritten as "bar.html". A command like this may be useful to update files that are later uploaded to a server.