Exemple #1
0
        /// <summary>
        /// Gets a help message for the <see cref="Command"/>.
        /// This method can be overridden to provide a command specific message.
        /// See the <see cref="GetSubCommandsMessage"/> and the <see cref="GetParametersMessage"/> methods.
        /// Messages can be combined using the + (plus) operator.
        /// </summary>
        /// <returns>A help <see cref="Message"/> for this <see cref="Command"/>.</returns>
        protected internal virtual Message GetHelpMessage()
        {
            var message = Message.NoError;

            if (subcommands.Any())
            {
                message += new Message("Commands:") + GetSubCommandsMessage(2);
            }

            if (parameters.Any())
            {
                message += new Message("Parameters:") + GetParametersMessage(2);
            }

            return(message);
        }