Example #1
0
        static void Run(CommandLineOptions options)
        {
            Console.WriteLine("Merging intellisense for {0}", Path.GetFileNameWithoutExtension(options.Output));

            // Load 'em.
            var inputs = options.Inputs.Select(XDocument.Load).ToList();

            // Merge 'em.
            var merged = MergeXml(inputs);

            // Save 'em.
            Directory.CreateDirectory(Path.GetDirectoryName(options.Output));

            merged.Save(options.Output);
        }
Example #2
0
        static int Main(string[] args)
        {
            // Parse commandline options.
            var options = new CommandLineOptions();
            var parser = new CommandLineParser(options);

            if (!parser.ParseCommandLine(args))
            {
                return 1;
            }

            // Run the program logic.
            try
            {
                Run(options);
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("Error: {0}\n\n{1}:\n{2}", e.Message, e.GetType(), e.StackTrace);
                return 1;
            }

            return 0;
        }