File inputFile = new File(input);
if(inputFile.isDirectory()) {
String outputDir = cmd.getOptionValue("o");
if(outputDir == null || !(new File(outputDir).isDirectory())) {
throw new FitsException("When FITS is run in directory processing mode the output location must be a diretory");
}
fits.doDirectory(inputFile,new File(outputDir),cmd.hasOption("x"),cmd.hasOption("xc"));
}
else {
FitsOutput result = fits.doSingleFile(inputFile);