public void DisplayHelp(params string[] remarks) { Console.Write("{0}", _utilityName); if (_switches.Count > 0) { Console.Write(" <switches>"); } foreach (CommandLineParameter el in _params) { Console.Write(" " + el.CommandLineText); } if (_multiParam != null) { Console.WriteLine(" " + _multiParam.CommandLineText); } Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Parameters:"); int maxNameLen = 0; foreach (CommandLineParameter p in _params) { maxNameLen = Math.Max(maxNameLen, p.NameDisplayLength); } if (_multiParam != null) { maxNameLen = Math.Max(maxNameLen, _multiParam.NameDisplayLength); } foreach (CommandLineParameter p in _params) { p.WriteDescription(Console.Out, " {0,-" + maxNameLen + "} {1}", 74 - maxNameLen); Console.WriteLine(); } if (_multiParam != null) { _multiParam.WriteDescription(Console.Out, " {0,-" + maxNameLen + "} {1}", 74 - maxNameLen); Console.WriteLine(); } Console.WriteLine("Switches:"); int maxSwitchLen = 0; foreach (CommandLineSwitch s in _switches) { maxSwitchLen = Math.Max(maxSwitchLen, s.SwitchDisplayLength); } foreach (CommandLineSwitch s in _switches) { s.WriteDescription(Console.Out, " {0,-" + maxSwitchLen + "} {1}", 74 - maxSwitchLen); Console.WriteLine(); } if (remarks.Length > 0) { Console.WriteLine("Remarks:"); foreach (var remark in remarks) { string[] text = Utilities.WordWrap(remark, 74); foreach (string line in text) { Console.WriteLine(" " + line); } Console.WriteLine(); } } }