public static void Main(String[] args) { var cl = new CommandLine(args); if ((args.Length == 0) || cl.DoesSwitchExist("help") || cl.DoesSwitchExist("?")) { DisplayHelp(); return; } var inputFilename = cl[0]; if (!File.Exists(inputFilename)) throw new ArgumentException(String.Format("The input file '{0}' does not exist.", inputFilename)); using (var kakuro = new Kakuro(inputFilename, cl.GetValue("outputfile", ""), cl.GetValue("logfile", ""), cl.DoesSwitchExist("log"))) { kakuro.Solve(); kakuro.Save(); } }
public static void Main(String[] args) { var cl = new CommandLine(args); if ((args.Length == 0) || cl.DoesSwitchExist("help") || cl.DoesSwitchExist("?")) { DisplayHelp(); return; } var inputFilename = cl[0]; if (!File.Exists(inputFilename)) { throw new ArgumentException(String.Format("The input file '{0}' does not exist.", inputFilename)); } using (var kakuro = new Kakuro(inputFilename, cl.GetValue("outputfile", ""), cl.GetValue("logfile", ""), cl.DoesSwitchExist("log"))) { kakuro.Solve(); kakuro.Save(); } }