public void SetArguments(ExecutingOptions options) { asm = options.Assembly; cfg = options.ConfigFile; bootStrapper = options.BootStrapper; hostType = options.Host; }
public void SetArguments(ExecutingOptions options) { asm = options.Assembly; cfg = options.ConfigFile; bootStrapper = options.BootStrapper; hostType = options.Host; }
public static void Main(string[] args) { var executingOptions = new ExecutingOptions(); if (Parser.ParseArguments(args, executingOptions) == false) { Console.WriteLine("Invalid arguments:"); Console.WriteLine("\t{0}", string.Join(" ", args)); Console.WriteLine(); Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions))); return; } try { actions[executingOptions.Action].Execute(executingOptions); } catch (Exception e) { log.Fatal("Host has crashed because of an error", e); // want to put the error in the error log if (executingOptions.Action == Action.Server) { throw; } } }
public static int Main(string[] args) { var executingOptions = new ExecutingOptions(); if (Parser.ParseArguments(args, executingOptions) == false) { Console.WriteLine("Invalid arguments:"); Console.WriteLine("\t{0}", string.Join(" ",args)); Console.WriteLine(); Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions))); return 1; } try { actions[executingOptions.Action].Execute(executingOptions); return 0; } catch (Exception e) { log.Fatal("Host has crashed because of an error",e); // want to put the error in the error log if(executingOptions.Action == Action.Server) throw; return 2; } }
public static int Main(string[] args) { var executingOptions = new ExecutingOptions(); if (Parser.ParseArguments(args, executingOptions) == false) { Console.WriteLine("Invalid arguments:"); Console.WriteLine("\t{0}", string.Join(" ", args)); Console.WriteLine(); Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions))); return(1); } var action = executingOptions.Action == Action.None ? (Environment.UserInteractive ? Action.Debug : Action.Server) : executingOptions.Action; executingOptions.Name = executingOptions.Name ?? Path.GetFileNameWithoutExtension(executingOptions.Assembly); try { log.Debug("Executing action: " + action); actions[action].Execute(executingOptions); return(0); } catch (Exception e) { Console.WriteLine(e); log.Fatal("Host has crashed because of an error", e); // want to put the error in the error log if (action == Action.Server) { throw; } return(2); } }
public static void Main(string[] args) { var executingOptions = new ExecutingOptions(); if (Parser.ParseArguments(args, executingOptions) == false) { Console.WriteLine("Invalid arguments:"); Console.WriteLine("\t{0}", string.Join(" ",args)); Console.WriteLine(); Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions))); return; } try { actions[executingOptions.Action].Execute(executingOptions); } catch (Exception e) { Console.WriteLine(e); } }
public static int Main(string[] args) { var executingOptions = new ExecutingOptions(); if (Parser.ParseArguments(args, executingOptions) == false) { Console.WriteLine("Invalid arguments:"); Console.WriteLine("\t{0}", string.Join(" ",args)); Console.WriteLine(); Console.WriteLine(Parser.ArgumentsUsage(typeof(ExecutingOptions))); return 1; } var action = executingOptions.Action == Action.None ? (Environment.UserInteractive ? Action.Debug : Action.Server) : executingOptions.Action; executingOptions.Name = executingOptions.Name ?? Path.GetFileNameWithoutExtension(executingOptions.Assembly); try { log.Debug("Executing action: " + action); actions[action].Execute(executingOptions); return 0; } catch (Exception e) { Console.WriteLine(e); log.Fatal("Host has crashed because of an error", e); // want to put the error in the error log if(action == Action.Server) throw; return 2; } }