Exemple #1
0
        /// <summary>
        /// Returns a string ready to show in a help command,
        /// having the command name, module name, summary, usage
        /// and aliases names, including the prefix
        /// </summary>
        public static string GetCommandInfo(this CommandInfo command, string prefix)
        {
            var aliases    = string.Join(", ", command.Aliases);
            var module     = command.Module.Name;
            var parameters = string.Join(", ", command.GetCommandParameters());
            var name       = command.GetCommandNameWithGroup();
            var summary    = command.Summary;
            var sb         = new StringBuilder()
                             .AppendLine($"**Command name**: {name}")
                             .AppendLine($"**Module**: {module}")
                             .AppendLine($"**Summary**: {summary}")
                             .AppendLine($"**Usage**: {prefix}{name} {parameters}")
                             .Append($"**Aliases**: {aliases}");

            return(sb.ToString());
        }