Пример #1
0
        /// <summary>
        /// Returns this <see cref="ParsedArguments"/> in a human readable format.
        /// </summary>
        /// <param name="detailed">True if the output should be detailed.</param>
        /// <returns>A <see cref="string"/>.</returns>
        public string ToString(bool detailed)
        {
            StringBuilder      returnValue      = new StringBuilder();
            ArgumentDictionary invalidArguments = ParsedArguments.GetInvalidArguments();
            ArgumentDictionary validArguments   = ParsedArguments.GetValidArguments();

            if (validArguments.Count > 0)
            {
                returnValue.AppendLine("Valid Arguments:");
                returnValue.AppendLine();

                foreach (Argument validArgument in validArguments.Values)
                {
                    returnValue.AppendLine(" " + validArgument.ToString(detailed));
                }
            }

            if (invalidArguments.Count > 0)
            {
                returnValue.AppendLine();
                returnValue.AppendLine("Invalid Arguments:");
                returnValue.AppendLine();

                foreach (Argument invalidArgument in invalidArguments.Values)
                {
                    returnValue.AppendLine(" " + invalidArgument.ToString(detailed));
                }
            }

            return(returnValue.ToString());
        }