feat: added diagnostic mode help (-d -h, or -de -h)
@@ -33,6 +33,12 @@ import com.synopsys.integration.detect.help.DetectOption;
import com.synopsys.integration.detect.help.DetectOptionHelp;
public class HelpPrinter {
+ private static final String DIAGNOSTIC_HELP_TEXT = "\nDiagnostics mode:\n\n" +
+ "In diagnostics mode, Detect will produce a diagnostics zip file that contains a collection of intermediate and output files\n" +
+ "that can be very useful for troubleshooting. Extended diagnostics mode writes additional files to the diagnostics zip file.\n" +
+ "Invoke diagnostics mode by adding -d (diagnostics mode) or -de (extended diagnostics mode) to the command line.\n" +
+ "The path to the generated diagnostics file can be found in the log (look for: \"Diagnostics file created at: ...\").\n" +
+ "The diagnostics file can be large, so you may want to generate it only when you will actually use it.\n";
private static final Comparator<DetectOption> SORT_BY_GROUP_THEN_KEY = (o1, o2) -> {
if (o1.getDetectOptionHelp().primaryGroup.equals(o2.getDetectOptionHelp().primaryGroup)) {
@@ -66,6 +72,8 @@ public class HelpPrinter {
} else {
printHelpFilteredBySearchTerm(writer, currentOptions, state.getParsedValue());
}
+ } else if (state.isDiagnostic() || state.isDiagnosticExtended()) {
+ printStream.println(DIAGNOSTIC_HELP_TEXT);
} else {
printDefaultHelp(writer, currentOptions);
}
@@ -175,7 +183,7 @@ public class HelpPrinter {
public void printStandardFooter(final HelpTextWriter writer, final String groupText) {
writer.println();
- writer.println("Usage : ");
+ writer.println("To set a Detect property on the command line: ");
writer.println("\t--<property name>=<value>");
writer.println();
writer.println("To see all properties, you may request verbose help log with '-hv'");
