Exemple #1
0
 private string ArgumentSyntax(ArgumentHelp arg)
 {
     return(string.Format("  {3}-{0} <{1}>{4} {6} {5}",
                          arg.PropertyInfo.Name,
                          arg.PropertyInfo.PropertyType.Name,
                          arg.IsRequired ? "* " : "  ",
                          !arg.IsRequired ? "[" : " ",
                          !arg.IsRequired ? "]" : " ",
                          string.IsNullOrEmpty(arg.HelpText) ? "" : arg.HelpText,
                          ""
                          ));
 }
Exemple #2
0
        private string MemberHelpText(ArgumentHelp taskAttribute)
        {
            var result = "";

            if (taskAttribute.IsRequired)
            {
                result = string.Format("-{0} value ",
                                       taskAttribute.PropertyInfo.Name,
                                       taskAttribute.HelpText,
                                       taskAttribute.IsRequired ? " *" : "");
            }
            else
            {
                result = string.Format("[-{0} {3} ]",
                                       taskAttribute.PropertyInfo.Name,
                                       taskAttribute.HelpText,
                                       taskAttribute.IsRequired ? " *" : "",
                                       taskAttribute.PropertyInfo.PropertyType.FullName == "System.Boolean" ? "[YES | no]" : "<value>"
                                       );
            }
            return(result);
        }