2626import net .sourceforge .argparse4j .inf .Namespace ;
2727import reposense .RepoSense ;
2828import reposense .model .AuthorBlurbMap ;
29+ import reposense .model .ChartBlurbMap ;
2930import reposense .model .CliArguments ;
3031import reposense .model .FileType ;
3132import reposense .model .RepoBlurbMap ;
@@ -345,6 +346,7 @@ public static CliArguments parse(String[] args) throws HelpScreenException, Pars
345346 addReportConfigToBuilder (cliArgumentsBuilder , results );
346347 addRepoBlurbMapToBuilder (cliArgumentsBuilder , results );
347348 addAuthorBlurbMapToBuilder (cliArgumentsBuilder , results );
349+ addChartBlurbMapToBuilder (cliArgumentsBuilder , results );
348350 addAnalysisDatesToBuilder (cliArgumentsBuilder , results );
349351
350352 boolean isViewModeOnly = reportFolderPath != null
@@ -390,7 +392,7 @@ private static void addReportConfigToBuilder(CliArguments.Builder builder, Names
390392 }
391393
392394 /**
393- * Adds the repoblurbMap field to the given {@code builder}.
395+ * Adds the repoBlurbMap field to the given {@code builder}.
394396 *
395397 * @param builder Builder to be supplied with the reportConfig field.
396398 * @param results Parsed results of the user-supplied CLI arguments.
@@ -415,7 +417,7 @@ private static void addRepoBlurbMapToBuilder(CliArguments.Builder builder, Names
415417 }
416418
417419 /**
418- * Adds the authorblurbMap field to the given {@code builder}.
420+ * Adds the authorBlurbMap field to the given {@code builder}.
419421 *
420422 * @param builder Builder to be supplied with the reportConfig field.
421423 * @param results Parsed results of the user-supplied CLI arguments.
@@ -439,6 +441,31 @@ private static void addAuthorBlurbMapToBuilder(CliArguments.Builder builder, Nam
439441 builder .authorBlurbMap (authorBlurbMap );
440442 }
441443
444+ /**
445+ * Adds the chartBlurbMap field to the given {@code builder}.
446+ *
447+ * @param builder Builder to be supplied with the reportConfig field.
448+ * @param results Parsed results of the user-supplied CLI arguments.
449+ */
450+ private static void addChartBlurbMapToBuilder (CliArguments .Builder builder , Namespace results ) {
451+ ChartBlurbMap chartBlurbMap = new ChartBlurbMap ();
452+ Path configFolderPath = results .get (CONFIG_FLAGS [0 ]);
453+
454+ // Blurbs are parsed regardless
455+ Path blurbConfigPath = configFolderPath .resolve (ChartBlurbMarkdownParser .DEFAULT_BLURB_FILENAME );
456+
457+ try {
458+ chartBlurbMap = new ChartBlurbMarkdownParser (blurbConfigPath ).parse ();
459+ } catch (InvalidMarkdownException ex ) {
460+ logger .warning (String .format (MESSAGE_INVALID_MARKDOWN_BLURBS , ex .getMessage ()));
461+ } catch (IOException ioe ) {
462+ // IOException thrown as blurbs.md is not found.
463+ // Ignore exception as the file is optional.
464+ }
465+
466+ builder .chartBlurbMap (chartBlurbMap );
467+ }
468+
442469 /**
443470 * Adds the sinceDate and untilDate fields for analysis to the given {@code builder}.
444471 *
0 commit comments