Command line method to walk the directories provided on the command line
and print out their contents

@param args Directory names
194598
public static void main(String[] args) {
        DirectoryIterator iter = new DirectoryIterator(args);
        while(iter.hasNext())
            System.out.println(iter.next().getAbsolutePath());
    }
637032
public static void main(final String[] args) {
        String url = "http://files.grouplens.org/datasets/movielens/ml-100k.zip";
        String folder = "data/ml-100k";
        String modelPath = "data/ml-100k/model/";
        String recPath = "data/ml-100k/recommendations/";
        String dataFile = "data/ml-100k/ml-100k/u.data";
        int nFolds = N_FOLDS;
        prepareSplits(url, nFolds, dataFile, folder, modelPath);
        recommend(nFolds, modelPath, recPath);
        // the strategy files are (currently) being ignored
        prepareStrategy(nFolds, modelPath, recPath, modelPath);
        evaluate(nFolds, modelPath, recPath);
    }
757122
void traverse(String[] args) {
        try {
            args = CommandLine.parse(args); // Detect @file and load it as a command line.
        } catch (java.io.IOException e) {
            throw new IllegalArgumentException("Problem reading @"+e.getMessage());
        }
        ArgumentIterator argIter = new ArgumentIterator(Arrays.asList(args));

        nextArg:
        while (argIter.hasNext()) {

            String arg = argIter.next();

            if (arg.startsWith("-")) {
                for (Option opt : Option.values()) {
                    if (opt.processCurrent(argIter, this))
                        continue nextArg;
                }

                javacArg(arg);

                // Does this javac argument take an argument? If so, don't
                // let it pass on to sjavac as a source root directory.
                for (com.sun.tools.javac.main.Option javacOpt : com.sun.tools.javac.main.Option.values()) {
                    if (javacOpt.matches(arg)) {
                        boolean takesArgument = javacOpt.hasArg();
                        boolean separateToken = !arg.contains(":") && !arg.contains("=");
                        if (takesArgument && separateToken)
                            javacArg(argIter.next());
                    }
                }
            } else {
                sourceRoots(Arrays.asList(Paths.get(arg)));
            }
        }
    }
275914
public static void main(final String[] args) {

        List<Image> images = describeAllImages();

        if (null != images) {
            for (Image image : images) {
                System.out.println(image.getImageId());
            }
        }

    }
176675
public void runArgs(String[] args) {
        CommandLineParser clParser = new DefaultParser();
        CommandLine line;
        String host;
        String port;
        CMD cmd;
        String[] cmdArgs;
        final PrintStream CONSOLE = System.out;
        try {
            // parse the command line arguments
            line = clParser.parse(options, args);

            if (line.hasOption("output")){
                String location = line.getOptionValue("output");
                File output = new File(location);
                FileOutputStream fos;
                try {
                    fos = new FileOutputStream(output);
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                    throw new ParseException(String.format("Wrong -o option. args %s\n",Arrays.asList(args)));
                }
                PrintStream out = new PrintStream(fos);
                System.setOut(out);

            }
            if (line.getOptions().length==0 || line.hasOption("help")) {
                if ((line.getOptions().length > 2) || (line.getOptions().length==2 && !line.hasOption("output"))){
                    throw new ParseException(String.format("Wrong -help option. args %s\n", Arrays.asList(args)));
                }
                printUsage(System.out);
            }
            if (line.hasOption("server")) {
                String server = line.getOptionValue("server");
                try {
                    host = server.split(":")[0];
                    port = server.split(":")[1];
                }catch (Exception e){
                    throw new ParseException(String.format("Wrong -server option. args %s\n", Arrays.asList(args)));
                }
                ServiceDirectory.getServiceDirectoryConfig().setProperty(
                        DirectoryServiceRestfulClient.SD_API_SD_SERVER_FQDN_PROPERTY,
                        host);
                ServiceDirectory.getServiceDirectoryConfig().setProperty(
                        DirectoryServiceRestfulClient.SD_API_SD_SERVER_PORT_PROPERTY,
                        port);
            }

            if (line.hasOption("exec")) {
                String commandString = line.getOptionValue("exec");
                cmdArgs = parseCommand(commandString);
                try {
                    cmd = CMD.valueOf(cmdArgs[0]);
                } catch (IllegalArgumentException e) {
                    throw new ParseException(String.format("Unknown command [ %s ] \n", commandString));
                }
                if (cmd.sizeOfArgs + 1 != cmdArgs.length) {
                    throw new ParseException(
                            String.format("Wrong arguments number for command %s, required %s but %s \n",
                                    cmdArgs[0], cmd.sizeOfArgs, cmdArgs.length - 1));
                }
                switch (cmd) {
                    case getInstanceOf:
                        lookupInstance(cmdArgs);
                        break;
                    case getAllInstancesOf:
                        lookupInstances(cmdArgs);
                        break;
                    case getAllServices:
                        getAllServices();
                        break;
                    case registerService:
                        registerService(cmdArgs);
                        break;
                    default:
                        fail("command " + cmd + " is unsupported yet");
                        break;
                }

            }
        } catch (ParseException exp) {
            // oops, something went wrong
            exp.printStackTrace();
            try {
                TimeUnit.MILLISECONDS.sleep(100L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            printUsage(System.err);
        }
        System.setOut(CONSOLE);
    }
856172
public static void walkin(File dir, List<File> files) {
        String pattern = ".POS";
        File[] listFile = dir.listFiles();
        if (listFile != null) {
            for (File file : listFile) {                
                if (file.isDirectory()) {
                    walkin(file, files);
                } else {
                    if (file.getName().endsWith(pattern)) {
                        files.add(file);
                    }
                }
            }
        }
    }
952128
public static void main(String[] args)
	{
		try
	    {
	        if (args.length == 0)
	            printUsage();
	        else
	        {
	            Settings settings = parseCommandLine(args);
	            if (settings != null)
	            	new FFMQJMXConsole(settings,
	            			           System.in,
	            			           System.out,
	            			           System.err).run();
	        }
	        
	        System.exit(0);
	    }
	    catch (IllegalArgumentException e)
	    {
	        System.err.println(e.getMessage());
	        System.exit(-1);
	    }
	    catch (Throwable e)
	    {
	        e.printStackTrace();
	        System.exit(-2);
	    }
	}
1024130
public void printCommandLine(CliDirectory workingDirectory, String commandLine) {
        final String text = '[' + workingDirectory.toPath() + "] " + Objects.requireNonNull(commandLine, "commandLine");
        println(text);
    }
1231187
public static void main(String[] args) {
        File from;
        File to;
        
        if (args.length < 2) {
            System.out.println("Usage:  DataMigrator <pathToSourceFile> <pathToDestFile>"); //$NON-NLS-1$
            return;
        }
        
        String frompath = args[0];
        String topath = args[1];
        
        from = new File(frompath);
        to = new File(topath);

        System.out.println("Starting data migration."); //$NON-NLS-1$
        System.out.println("  From: " + from); //$NON-NLS-1$
        System.out.println("  To:   " + to); //$NON-NLS-1$
        DataMigrator migrator = new DataMigrator();
        migrator.setLogger(new SystemOutLogger());
        Version version = new Version();
        version.postConstruct();
        migrator.setVersion(version);
        migrator.migrate(from, to);
    }
202613
public static void main(final String[] args) {
        Switch about = new Switch("a", "about", "display about message");
        Switch help = new Switch("h", "help", "display help message");
        FileArgument fastaFile = new FileArgument("i", "fasta-file", "input hard-masked FASTA file, default stdin", false);
        FileArgument bedFile = new FileArgument("o", "bed-file", "output BED file, default stdout", false);

        ArgumentList arguments = new ArgumentList(about, help, fastaFile, bedFile);
        CommandLine commandLine = new CommandLine(args);

        MaskedToBed maskedToBed = null;
        try {
            CommandLineParser.parse(commandLine, arguments);
            if (about.wasFound()) {
                About.about(System.out);
                System.exit(0);
            }
            if (help.wasFound()) {
                Usage.usage(USAGE, null, commandLine, arguments, System.out);
                System.exit(0);
            }
            maskedToBed = new MaskedToBed(fastaFile.getValue(), bedFile.getValue());
        }
        catch (CommandLineParseException e) {
            Usage.usage(USAGE, e, commandLine, arguments, System.err);
            System.exit(-1);
        }
        try {
            System.exit(maskedToBed.call());
        }
        catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
102892
public static void main(String[] args) {
		PrintStream out = System.out;
		if (args.length > 0) {
			try {
				out = new PrintStream(new File(args[0]));
			} catch (FileNotFoundException e) {
				System.out.printf(ERR_FILE, args[0]);
			}
		}
		MBeanScanner mBeanScanner = new MBeanScanner();
		List<Config> configs = mBeanScanner.scan();
		ConfigWriter cw;
		cw = new ConfigWriter(out, configs);
		cw.write();
	}
773262
public static void main(String[] args) {
        if (args.length != 2) {
            System.err.println("Please specify dir or filename | output file location");
            return;
        }

        StopwordsGenerator stopwordsGenerator = new StopwordsGenerator();

        File file = new File(args[0]);

        if (file.isFile()) {
            WikiSingleWordCount.generateFromFile(file, stopwordsGenerator);
        } else {
            File[] files = file.listFiles();
            Arrays.stream(files).parallel()
                    .filter(File::isFile)
                    .forEach(f -> WikiSingleWordCount.generateFromFile(f, stopwordsGenerator));
        }

        stopwordsGenerator.normalize();
        List<Map.Entry<String, Double>> result = stopwordsGenerator.getProbability()
                .entrySet().stream()
                .sorted((o1, o2) -> o2.getValue().compareTo(o1.getValue()))
                .collect(Collectors.toList());
        stopwordsGenerator.writeFile(args[1], result);
    }
239108
public static void main(final String[] args) {
        Switch about = new Switch("a", "about", "display about message");
        Switch help = new Switch("h", "help", "display help message");
        FileArgument referenceFile = new FileArgument("r", "reference", "reference input file, in fasta format, default stdin", false);
        FileArgument firstReadFile = new FileArgument("1", "first-read", "first read output file, in fastq format", true);
        FileArgument secondReadFile = new FileArgument("2", "second-read", "second read output file, in fastq format", true);
        DoubleArgument meanLength = new DoubleArgument("l", "mean-length", "mean length, default " + DEFAULT_MEAN_LENGTH, false);
        DoubleArgument lengthVariation = new DoubleArgument("v", "length-variation", "length variation, default " + DEFAULT_LENGTH_VARIATION, false);
        DoubleArgument meanInsertSize = new DoubleArgument("j", "mean-insert-size", "mean insert size, default " + DEFAULT_MEAN_INSERT_SIZE, false);
        DoubleArgument insertSizeVariation = new DoubleArgument("k", "insert-size-variation", "insert size variation, default " + DEFAULT_INSERT_SIZE_VARIATION, false);
        IntegerArgument minimumCoverage = new IntegerArgument("c", "minimum-coverage", "minimum coverage, default " + DEFAULT_MINIMUM_COVERAGE, false);
        IntegerArgument meanCoverage = new IntegerArgument("g", "mean-coverage", "mean coverage", false);
        StringArgument qualityType = new StringArgument("u", "quality", "quality strategy type { illumina, normal }, default normal", false);
        DoubleArgument meanQualityWeight = new DoubleArgument("w", "mean-quality-weight", "mean quality weight, default " + DEFAULT_MEAN_QUALITY_WEIGHT, false);
        DoubleArgument qualityWeightVariation = new DoubleArgument("t", "quality-weight-variation", "quality weight variation, default " + DEFAULT_QUALITY_WEIGHT_VARIATION, false);
        DoubleArgument meanQuality = new DoubleArgument("q", "mean-quality", "mean quality, default " + DEFAULT_MEAN_QUALITY, false);
        DoubleArgument qualityVariation = new DoubleArgument("f", "quality-variation", "quality variation, default " + DEFAULT_QUALITY_VARIATION, false);
        StringArgument mutationType = new StringArgument("m", "mutation", "mutation strategy type { substitution, insertion, deletion, ambiguous, indel, composite }, default identity", false);
        DoubleArgument extendInsertionRate = new DoubleArgument("x", "extend-insertion-rate", "extend insertion rate, default " + DEFAULT_EXTEND_INSERTION_RATE, false);
        IntegerArgument maximumInsertionLength = new IntegerArgument("e", "maximum-insertion-length", "maximum insertion length, default " + DEFAULT_MAXIMUM_INSERTION_LENGTH, false);
        DoubleArgument insertionRate = new DoubleArgument("i", "insertion-rate", "insertion rate, default " + DEFAULT_INSERTION_RATE, false);
        DoubleArgument deletionRate = new DoubleArgument("d", "deletion-rate", "deletion rate, default " + DEFAULT_DELETION_RATE, false);
        DoubleArgument substitutionRate = new DoubleArgument("s", "substitution-rate", "substitution rate, default " + DEFAULT_SUBSTITUTION_RATE, false);
        DoubleArgument indelRate = new DoubleArgument("y", "indel-rate", "indel rate, default " + DEFAULT_INDEL_RATE, false);
        DoubleArgument ambiguousRate = new DoubleArgument("b", "ambiguous-rate", "ambiguous substitution rate, default " + DEFAULT_AMBIGUOUS_RATE, false);
        DoubleArgument mutationRate = new DoubleArgument("n", "mutation-rate", "mutation rate, default " + DEFAULT_MUTATION_RATE, false);
        IntegerArgument seed = new IntegerArgument("z", "seed", "random number seed, default relates to current time", false);

        ArgumentList arguments = new ArgumentList(about, help, referenceFile, firstReadFile, secondReadFile, meanLength, lengthVariation,
                                                  meanInsertSize, insertSizeVariation, minimumCoverage, meanCoverage,
                                                  qualityType, meanQualityWeight, qualityWeightVariation, meanQuality, qualityVariation,
                                                  mutationType, extendInsertionRate, maximumInsertionLength, insertionRate, deletionRate,
                                                  substitutionRate, indelRate, ambiguousRate, mutationRate, seed);

        CommandLine commandLine = new CommandLine(args);

        GeneratePairedEndReads generatePairedEndReads = null;
        try {
            CommandLineParser.parse(commandLine, arguments);
            if (about.wasFound()) {
                About.about(System.out);
                System.exit(0);
            }
            if (help.wasFound()) {
                Usage.usage(USAGE, null, commandLine, arguments, System.out);
                System.exit(0);
            }

            RandomGenerator random = seed.wasFound() ? new MersenneTwister(seed.getValue()) : new MersenneTwister();

            double lv = Math.max(NO_VARIATION, lengthVariation.getValue(DEFAULT_LENGTH_VARIATION));
            RealDistribution length = new NormalDistribution(random, meanLength.getValue(DEFAULT_MEAN_LENGTH), lv, NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);

            double isv = Math.max(NO_VARIATION, insertSizeVariation.getValue(DEFAULT_INSERT_SIZE_VARIATION));
            RealDistribution insertSize = new NormalDistribution(random, meanInsertSize.getValue(DEFAULT_MEAN_INSERT_SIZE), isv, NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);

            CoverageStrategy coverage = DEFAULT_COVERAGE;
            if (minimumCoverage.wasFound()) {
                coverage = new MinimumCoverageStrategy(minimumCoverage.getValue());
            }
            else if (meanCoverage.wasFound()) {
                coverage = new MeanCoverageStrategy(meanCoverage.getValue());
            }

            QualityStrategy quality = null;
            if ("illumina".equals(qualityType.getValue())) {
                RealDistribution realDistribution = new NormalDistribution(random, meanQualityWeight.getValue(DEFAULT_MEAN_QUALITY_WEIGHT), qualityWeightVariation.getValue(DEFAULT_QUALITY_WEIGHT_VARIATION), NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
                quality = new ScoreFunctionQualityStrategy(realDistribution, ScoreFunctions.illumina());
            }
            else {
                RealDistribution realDistribution = new NormalDistribution(random, meanQuality.getValue(DEFAULT_MEAN_QUALITY), qualityVariation.getValue(DEFAULT_QUALITY_VARIATION), NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
                quality = new RealDistributionQualityStrategy(realDistribution);
            }

            MutationStrategy mutation = DEFAULT_MUTATION;
            if (mutationType.wasFound()) {
                if ("substitution".equals(mutationType.getValue())) {
                    mutation = new SubstitutionMutationStrategy(random);
                }
                else if ("ambiguous".equals(mutationType.getValue())) {
                    mutation = new AmbiguousSubstitutionMutationStrategy();
                }
                else if ("insertion".equals(mutationType.getValue())) {
                    mutation = new InsertionMutationStrategy(random, extendInsertionRate.getValue(DEFAULT_EXTEND_INSERTION_RATE), maximumInsertionLength.getValue(DEFAULT_MAXIMUM_INSERTION_LENGTH));
                }
                else if ("deletion".equals(mutationType.getValue())) {
                    mutation = new DeletionMutationStrategy();
                }
                else if ("indel".equals(mutationType.getValue())) {
                    InsertionMutationStrategy insertion = new InsertionMutationStrategy(random, insertionRate.getValue(DEFAULT_INSERTION_RATE), maximumInsertionLength.getValue(DEFAULT_MAXIMUM_INSERTION_LENGTH));
                    DeletionMutationStrategy deletion = new DeletionMutationStrategy();
                    mutation = new IndelMutationStrategy(random, insertion, insertionRate.getValue(DEFAULT_INSERTION_RATE), deletion, deletionRate.getValue(DEFAULT_DELETION_RATE));
                }
                else if ("composite".equals(mutationType.getValue())) {
                    SubstitutionMutationStrategy substitution = new SubstitutionMutationStrategy(random);
                    InsertionMutationStrategy insertion = new InsertionMutationStrategy(random, insertionRate.getValue(DEFAULT_INSERTION_RATE), maximumInsertionLength.getValue(DEFAULT_MAXIMUM_INSERTION_LENGTH));
                    DeletionMutationStrategy deletion = new DeletionMutationStrategy();
                    IndelMutationStrategy indel = new IndelMutationStrategy(random, insertion, insertionRate.getValue(DEFAULT_INSERTION_RATE), deletion, deletionRate.getValue(DEFAULT_DELETION_RATE));
                    AmbiguousSubstitutionMutationStrategy ambiguous = new AmbiguousSubstitutionMutationStrategy();
                    mutation = new CompositeMutationStrategy(random, substitution, substitutionRate.getValue(DEFAULT_SUBSTITUTION_RATE), indel, indelRate.getValue(DEFAULT_INDEL_RATE), ambiguous, ambiguousRate.getValue(DEFAULT_AMBIGUOUS_RATE));
                }
            }

            generatePairedEndReads = new GeneratePairedEndReads(referenceFile.getValue(), firstReadFile.getValue(), secondReadFile.getValue(), random, length, insertSize, quality, coverage, mutationRate.getValue(DEFAULT_MUTATION_RATE), mutation);
        }
        catch (CommandLineParseException e) {
            if (about.wasFound()) {
                About.about(System.out);
                System.exit(0);
            }
            if (help.wasFound()) {
                Usage.usage(USAGE, null, commandLine, arguments, System.out);
                System.exit(0);
            }
            Usage.usage(USAGE, e, commandLine, arguments, System.err);
            System.exit(-1);
        }
        try {
            System.exit(generatePairedEndReads.call());
        }
        catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
108715
public static void main(final String[] args) {
        Switch about = new Switch("a", "about", "display about message");
        Switch help = new Switch("h", "help", "display help message");
        FileArgument referenceFastaFile = new FileArgument("r", "reference", "input reference FASTA file", true);
        FileArgument scaffoldsFastaFile = new FileArgument("s", "scaffolds", "input scaffolds FASTA file", true);
        FileArgument evalFile = new FileArgument("e", "eval", "output eval file, default stdout", false);

        ArgumentList arguments = new ArgumentList(about, help, referenceFastaFile, scaffoldsFastaFile, evalFile);
        CommandLine commandLine = new CommandLine(args);

        EvaluateScaffolds evaluateScaffolds = null;
        try {
            CommandLineParser.parse(commandLine, arguments);
            if (about.wasFound()) {
                About.about(System.out);
                System.exit(0);
            }
            if (help.wasFound()) {
                Usage.usage(USAGE, null, commandLine, arguments, System.out);
                System.exit(0);
            }
            evaluateScaffolds = new EvaluateScaffolds(referenceFastaFile.getValue(), scaffoldsFastaFile.getValue(), evalFile.getValue());
        }
        catch (CommandLineParseException e) {
            if (about.wasFound()) {
                About.about(System.out);
                System.exit(0);
            }
            if (help.wasFound()) {
                Usage.usage(USAGE, null, commandLine, arguments, System.out);
                System.exit(0);
            }
            Usage.usage(USAGE, e, commandLine, arguments, System.err);
            System.exit(-1);
        }
        try {
            System.exit(evaluateScaffolds.call());
        }
        catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
290382
public static void main(String[] args) throws IOException
    {
        process_command_line(args);

        info = new JarInfo();

        if (printVersion) {
            doPrintVersion();
        }
        if (printHelp) {
            doPrintHelp();
        }
    }
265528
public static void main(String[] args) {
        for (Version v: identify().values()) {
            System.err.println(v);
        }
    }
102693
public static void main(String args[]) {
		SmapGenerator g = new SmapGenerator();
		g.setOutputFileName("foo.java");
		SmapStratum s = new SmapStratum("JSP");
		s.addFile("foo.jsp");
		s.addFile("bar.jsp", "/foo/foo/bar.jsp");
		s.addLineData(1, "foo.jsp", 1, 1, 1);
		s.addLineData(2, "foo.jsp", 1, 6, 1);
		s.addLineData(3, "foo.jsp", 2, 10, 5);
		s.addLineData(20, "bar.jsp", 1, 30, 1);
		g.addStratum(s, true);
		System.out.print(g);

		System.out.println("---");

		SmapGenerator embedded = new SmapGenerator();
		embedded.setOutputFileName("blargh.tier2");
		s = new SmapStratum("Tier2");
		s.addFile("1.tier2");
		s.addLineData(1, "1.tier2", 1, 1, 1);
		embedded.addStratum(s, true);
		g.addSmap(embedded.toString(), "JSP");
		System.out.println(g);
	}