package dfixer;

import java.io.*;

public class Main {
	

	public static void main(String[] args) throws IOException, InterruptedException{
		
		if(args.length==0){
			System.out.println("Err: No parameter.");
			System.exit(0);
		}
		
		if(args.length==1){
			System.out.println("Err: Two parameters.");
			System.exit(0);
		}
		
		if(args.length>2)
		{
			System.out.println("Err: Two parameters. ");
			System.exit(0);
		}
		
		String insname;
		
		File f1 = new File(args[0]);
		if(!f1.isDirectory())
		{
			System.out.println("Err: First parameter should be a folder.");
			System.exit(0);
		}
		
		int index = args[1].lastIndexOf('/');
		if(index>-1)
			insname = args[1].substring(index+1, args[1].length());
		else
			insname = args[1];
		
		FileGen fg = new FileGen(insname,args[0]);
		fg.Gen();
		
		System.out.println("Finish.");
	
	}
}

