From be2da029c68b1a70a97d94235160d2a39b7649bc Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 16 Jun 2010 00:57:05 +0300 Subject: [PATCH] Output messages and progress to stderr --- wp2git.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp2git.d b/wp2git.d index 9c2342a..3331f7b 100644 --- a/wp2git.d +++ b/wp2git.d @@ -9,7 +9,7 @@ int main(string[] args) { if (args.length != 2) { - writefln("Usage: %s Article_name", args[0]); + fwritefln(stderr, "Usage: %s Article_name", args[0]); return 1; } @@ -20,12 +20,14 @@ int main(string[] args) if (spawnvp(P_WAIT, "curl", ["curl", "-d", "\"\"", "http://en.wikipedia.org/w/index.php?title=Special:Export&pages=" ~ name, "-o", "history.xml"])) throw new Exception("curl error"); + fwritefln(stderr, "Loading history..."); auto xml = new XmlDocument(new File("history.xml")); string data; foreach (child; xml[0]["page"]) if (child.tag=="revision") { + fwritefln(stderr, "Revision %s", child["id"].text); string summary = child["comment"] ? child["comment"].text : null; string text = child["text"].text; data ~=