private void VerifyThenRun() { try { if (!CommandLineParameterBase.ShowHelp) { if (CommandLineParameterBase.VerifyArguments()) { try { RunBase(); return; } catch (Exception exception) { Console.Error.WriteLine(); Console.Error.WriteLine("Exiting program with exception: {0}", exception.Message); Console.Out.WriteLine("===== DETAIL ======"); Console.Out.WriteLine(exception); } } } ShowHelp(); } catch (InvalidOperationException) { ShowHelp(); } }
public CommandLineParser(CommandLineParameterBase argumentSource) { Arguments = new List <CommandLineArgument>(); ArgumentsSource = argumentSource; ArgumentsMap = GetPropertyMap(); }
protected CommandLineProgramBase(CommandLineParameterBase commandLineParameterBase, string[] args) { CommandLineParameterBase = commandLineParameterBase; CommandLineParameterBase.LoadArguments(args); VerifyThenRun(); }
public void ShowHelp() { ShowLogo(); CommandLineParameterBase.ShowUsage(); }