parser.accepts("p", "sync one page").withRequiredArg().ofType(String.class);
parser.accepts("h", "changes since x hours ago").withRequiredArg().ofType(Integer.class);
OptionSet options = parser.parse(args);
String root = "/usr/local/bin/gwsync/";
root = (String) (options.hasArgument("r") ? options.valueOf("r") : root);
Sync sync = Sync.newFromConfigFile(root+"sync.conf");
String ncboAPIKey = sync.getProperties().getProperty("ncbo.api.key");
String doidFile = sync.getProperties().getProperty("doid.file");
sync.addRewriter(new GeneWikiEditor(root, ncboAPIKey, doidFile));
if (options.hasArgument("p")) {
sync.runForPages((String) options.valueOf("p"));
} else if (options.hasArgument("h")) {
sync.runChangesFromHoursAgo((Integer)options.valueOf("h"));
} else {
sync.run();
}
}