public override string ToString() { if (Options.Any()) { var optionsJoined = Options.Select(o => o.Name).JoinToString(", "); return(!CommandName.IsNullOrWhiteSpace() ? $"{CommandName} / [{optionsJoined}]" : $"[{optionsJoined}]"); } else { return(!CommandName.IsNullOrWhiteSpace() ? $"{CommandName} / no options" : "no options"); } }
/// <inheritdoc /> public override string ToString() { var buffer = new StringBuilder(); if (!CommandName.IsNullOrWhiteSpace()) { buffer.Append(CommandName); } foreach (var directive in Directives) { buffer.AppendIfNotEmpty(' '); buffer.Append(directive); } foreach (var option in Options) { buffer.AppendIfNotEmpty(' '); buffer.Append(option); } return(buffer.ToString()); }