au.csiro.sparkle.common.args4j.ArgsObjectFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of variant-spark_2.11 Show documentation
Show all versions of variant-spark_2.11 Show documentation
Genomic variants interpretation toolkit
The newest version!
package au.csiro.sparkle.common.args4j;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.stream.Collectors;
import org.kohsuke.args4j.CmdLineParser;
import au.csiro.sparkle.cmd.DefaultObjectFactory;
public class ArgsObjectFactory extends DefaultObjectFactory implements HasUsage {
@Override
public String getShortUsage() {
return modules.keySet().stream().collect(Collectors.joining("|"));
}
@Override
public void printUsage(OutputStream out) {
final PrintStream pout = new PrintStream(out);
modules.forEach((name,provider) -> {
pout.print(name);
CmdLineParser parser = new CmdLineParser(provider.provide());
parser.printSingleLineUsage(out);
pout.println();
parser.printUsage(out);
});
}
}