package leigh.astro.app;

import leigh.astro.fits.FitsScanner;
import leigh.mecha.log.MechaLogger;
import leigh.mecha.log.MechaLoggerFactory;
import leigh.mecha.util.UniversalJob;

import java.io.IOException;
import java.nio.file.Paths;

/**
 * A utility operation to scan a path of FITS files and remove any duplicates which are found. This app uses
 * the {@link FitsScanner} class and obeys the mechanics of the <code>removeDupes</code> method.
 *
 * @author Alex Leigh
 */
public class FitsRemoveDupeApp {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(FitsRemoveDupeApp.class);

    public static void main(String args[]) throws IOException {
        if (args.length != 1) {
            logger.info("Usage: FitsRemoveDupeAPp path");
            System.exit(UniversalJob.RET_BADARGS);
        }

        FitsScanner scanner = new FitsScanner();
        scanner.removeDupes(Paths.get(args[0]));
    }
}
