new public string PrintHelpText() { StringBuilder help = new StringBuilder(); help.AppendLine("Required flags"); foreach (var prop in this.GetType().GetProperties()) { if (prop.GetCustomAttributes(typeof(CommandLineArgAttribute), true).FirstOrDefault() is CommandLineArgAttribute cmdAttribute) { help.AppendFormat("{0,-40}\t\t{1,-100}", cmdAttribute.Usage, cmdAttribute.Description); //if (!String.IsNullOrWhiteSpace (cmdAttribute.DefaultValue)) // help.AppendFormat ("\t Default:{0,-40}\n", cmdAttribute.DefaultValue); //else // help.Append ("\n"); } } help.AppendLine(new String('-', 180)); help.AppendLine("InfluxDB related flags"); help.Append(InfluxDB.PrintHelpText()); help.AppendLine(new String('-', 180)); help.AppendLine("Perfmon file format related flags"); help.Append(PerfmonFile.PrintHelpText()); help.AppendLine(new String('-', 180)); help.AppendLine("Generic delimited file format related flags"); help.Append(GenericFile.PrintHelpText()); return(help.ToString()); }