Exemplo n.º 1
0
        /// <summary>
        /// Composes basic syntax info.
        /// </summary>
        /// <param name="options">Options for generating syntax info.</param>
        /// <returns>The composed info.</returns>
        public string GetBasicSyntax(ArgumentSyntaxHelpOptions options)
        {
            IEnumerable <ArgumentUsageInfo> args;

            args = options.IncludeOptionalArguments ? AllParameters : RequiredParameters;

            var syntax = args.Select(arg =>
            {
                if (arg.IsSelectedCommand())
                {
                    return(arg.ArgumentType.Format(arg.CurrentValue));
                }

                return(arg.GetSyntaxSummary());
            });

            return(string.Join(" ", syntax));
        }
 /// <summary>
 /// Deeply cloning constructor.
 /// </summary>
 /// <param name="other">Template for clone.</param>
 private ArgumentSyntaxHelpOptions(ArgumentSyntaxHelpOptions other) : base(other)
 {
     CommandNameColor         = other.CommandNameColor;
     IncludeOptionalArguments = other.IncludeOptionalArguments;
 }