X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.core%2Fsrc%2Forg%2Fargeo%2Fsync%2Fcli%2FSync.java;fp=org.argeo.core%2Fsrc%2Forg%2Fargeo%2Fsync%2Fcli%2FSync.java;h=0000000000000000000000000000000000000000;hb=a8731626eaf812794bec138649de575e6e036245;hp=d21b5a255833c86eb3334534ff277dad5fa25527;hpb=4835aba6de0e6e2f7ef2da9e3bd19adca661c8bc;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.core/src/org/argeo/sync/cli/Sync.java b/org.argeo.core/src/org/argeo/sync/cli/Sync.java deleted file mode 100644 index d21b5a255..000000000 --- a/org.argeo.core/src/org/argeo/sync/cli/Sync.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.argeo.sync.cli; - -import java.net.URI; -import java.nio.file.Paths; -import java.util.List; - -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.argeo.sync.fs.PathSync; - -public class Sync { - - public static void main(String[] args) { - Options options = new Options(); - options.addOption("r", "recursive", false, "recurse into directories"); - options.addOption(Option.builder().longOpt("progress").hasArg(false).desc("show progress").build()); - - CommandLineParser parser = new DefaultParser(); - try { - CommandLine line = parser.parse(options, args); - List remaining = line.getArgList(); - if (remaining.size() == 0) { - System.err.println("There must be at least one argument"); - printHelp(options); - System.exit(1); - } - URI sourceUri = new URI(remaining.get(0)); - URI targetUri; - if (remaining.size() == 1) { - targetUri = Paths.get(System.getProperty("user.dir")).toUri(); - } else { - targetUri = new URI(remaining.get(1)); - } - PathSync pathSync = new PathSync(sourceUri, targetUri); - pathSync.run(); - } catch (Exception exp) { - exp.printStackTrace(); - printHelp(options); - System.exit(1); - } - } - - public static void printHelp(Options options) { - HelpFormatter formatter = new HelpFormatter(); - formatter.printHelp("sync SRC [DEST]", options, true); - } - -}