public void ShowHelpOverview(IEnumerable<ICommand> commands)
{
if (commands == null)
{
throw new ArgumentNullException("commands");
}
// version
this.userInterface.WriteLine(string.Format("{0} ({1})", this.applicationInformation.ApplicationName, this.applicationInformation.ApplicationVersion));
this.userInterface.WriteLine(string.Empty);
// usage
string usageLabel = Resources.HelpCommand.UsageLabel + ":" + Environment.NewLine;
this.userInterface.WriteLine(usageLabel);
string usageText = string.Format(Resources.HelpCommand.UsagePattern, this.applicationInformation.NameOfExecutable);
this.userInterface.ShowIndented(usageText, 4);
this.userInterface.WriteLine(string.Empty);
// help
string helpLabel = Resources.HelpCommand.HelpLabel + ":" + Environment.NewLine;
this.userInterface.WriteLine(helpLabel);
string helpText = string.Format(Resources.HelpCommand.HelpPattern, this.applicationInformation.NameOfExecutable);
this.userInterface.ShowIndented(helpText, 4);
this.userInterface.WriteLine(string.Empty);
// available commands
string availableCommandsLabel = Resources.HelpCommand.AvailableCommandsLabel + ":";
this.userInterface.WriteLine(availableCommandsLabel);
this.userInterface.WriteLine(string.Empty);
// display command name and description
this.userInterface.ShowKeyValueStore(
commands.ToDictionary(g => g.Attributes.CommandName, v => v.Attributes.Description),
distanceBetweenColumns: 4,
indentation: 2);
this.userInterface.WriteLine(string.Empty);
}