static void ExecuteCommand(CommandLineOptions options) { var stopWatch = new Stopwatch(); stopWatch.Start(); if (options.Debug) LogManager.Adapter = new ConsoleOutLoggerFactoryAdapter(); if (options.ListJavaScriptResources) ListJavaScriptResources(); else if (options.ShowJavaScriptResource) ShowJavaScriptResource(options.JavaScript); else if (!String.IsNullOrEmpty(options.FunctionName)) { if (options.Run) RunJavaScrtiptFunction(options.JavaScript, options.FunctionName, options.Args); else ExecuteJavaScrtiptFunction(options.JavaScript, options.FunctionName, options.Args); } else if (options.Run) { Console.WriteLine("Please specify a JavaScript file to run!"); } if (options.MeasureTime) Console.WriteLine("Elapsed Time: {0}ms", stopWatch.ElapsedMilliseconds); }
public static void Main(string[] args) { var options = new CommandLineOptions(); if (CommandLine.Parser.Default.ParseArguments(args, options)) { ExecuteCommand(options); } }