Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            FluentCommandLineParser parser = new FluentCommandLineParser();

            ListSchemaConvertToSiteScriptArgs.Setup(parser, ConvertListSchema);

            parser.Parse(args);
        }
Ejemplo n.º 2
0
 static void ConvertListSchema(ListSchemaConvertToSiteScriptArgs args)
 {
     try
     {
         string outputFilePath = args.OutputFilePath ?? "site-script.json";
         using (var fs = File.OpenWrite(outputFilePath))
         {
             var siteScript = CAMLSchemaToSiteScriptConverter.ConvertListSchema(args.SchemaFilePath);
             SiteScriptJsonSerializer.Serialize(siteScript, fs);
         }
     }
     catch (Exception ex)
     {
         Console.Error.WriteLine("An error occured while converting List Schema to Site Script");
         Console.Error.Write(ex.ToString());
     }
 }