Exemple #1
0
        private static void Main(string[] args)
        {
            paramList.Add("input", a => inputFile     = a);
            paramList.Add("output", a => outputFile   = a);
            paramList.Add("template", a => template   = a);
            paramList.Add("linecount", a => lineCount = int.Parse(a));
            ParseArguments(args);

            CheckArguments();

            var buffer = CopyrightUtil.ReadFile(inputFile);

            if (buffer.Count > 0)
            {
                if (lineCount > buffer.Count)
                {
                    lineCount = buffer.Count;
                }
                var copyright = new Copyright(companyTemplate);
                if (copyright.FindCurrentCopyright(buffer, lineCount))
                {
                    Console.WriteLine("Current Copyright already exists.");
                    return;
                }

                copyright.AddOrModifyCopyright(buffer, lineCount);
                CopyrightUtil.WriteFile(outputFile, buffer);
            }
        }