protected override void InnerExecute(string[] arguments)
{
_writer.WriteLine("Usage: appharbor COMMAND [command-options]");
_writer.WriteLine("");
_writer.WriteLine("Available commands:");
_writer.WriteLine("");
foreach (var commandType in _commandTypes.Where(x => x.IsClass)
.OrderBy(x => GetScope(x))
.ThenBy(x => x.Name))
{
var usageStringBuilder = new StringBuilder();
var splitted = SplitUpperCase(commandType.Name).Where(x => x != "Command");
usageStringBuilder.Append(" ");
usageStringBuilder.Append(string.Join(" ", splitted.Reverse()));
var helpAttribute = commandType.GetCustomAttributes(true).OfType<CommandHelpAttribute>().Single();
usageStringBuilder.Append(string.Format(" {0}", helpAttribute.Options));
while (usageStringBuilder.Length < 30)
{
usageStringBuilder.Append(" ");
}
_writer.Write(usageStringBuilder.ToString().ToLower());
_writer.Write(string.Concat("# ", helpAttribute.Description));
if (!string.IsNullOrEmpty(helpAttribute.Alias))
{
_writer.Write(" (\"{0}\")", helpAttribute.Alias);
}
_writer.WriteLine();
}
_writer.WriteLine();
_writer.WriteLine("Common options:");
OptionSet.WriteOptionDescriptions(_writer);
}