Esempio n. 1
0
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("Komento puuttuu!");
                return;
            }

            string command = args[0];

            if (command.Equals("otsikot"))
            {
                if (args.Length != 3 && args.Length != 4)
                {
                    PrintHeadersHelp();
                    return;
                }

                if (args.Length == 3)
                {
                    BigXMLProcess.PrintNFirst(inputXMLfilePath: args[2], howMany: int.Parse(args[1]));
                }
                else if (args.Length == 4)
                {
                    BigXMLProcess.PrintNFirst(inputXMLfilePath: args[2], howMany: int.Parse(args[1]), outputFilePath: args[3]);
                }
            }
            else if (command.Equals("kaannokset"))
            {
                if (args.Length != 4)
                {
                    PrintTranslationsHelp();
                    return;
                }

                BigXMLProcess.PrintNFirstTranslations(inputXMLfilePath: args[3], howMany: int.Parse(args[1]), translationLanguage: RemoveQuotesIfNeeded(args[2]));
            }
            else if (command.Equals("teejson"))
            {
                if (args.Length != 6)
                {
                    PrintCreateJSONHelp();
                    return;
                }

                BigXMLProcess.CreateNFirstTranslationsJSON(inputXMLfilePath: args[3], howMany: int.Parse(args[1]), translationLanguage: args[2], bannedWordsListPath: args[4], outputFilePath: args[5]);
            }
            else if (command.Equals("mehusta"))
            {
                if (args.Length != 5)
                {
                    PrintCreateJuicedJSONsHelp();
                    return;
                }

                JsonProcess.JuiceJsonFiles(args[1], args[2], args[3], args[4]);
            }
        }