From e937b62215298f3052fb8b0977703520e48f36e2 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 15 Sep 2026 18:04:25 +0200 Subject: [PATCH] Wire merge command to the new MergeStrategy MergeCommand now calls CycloneDXUtils.FlatMerge/HierarchicalMerge with MergeStrategy.Default() when built against a library that has it (#if NET8_0_OR_GREATER, matching the library's own guard -- CLI is net10.0-only today but this keeps the two projects' conditional compilation symmetric and self-documenting), falling back to the plain overload otherwise. No new CLI flags: strategy toggles are not yet exposed at the command-line layer, so this only changes default merge behavior, not the command's surface. Signed-off-by: Jim Klimov --- src/cyclonedx/Commands/MergeCommand.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cyclonedx/Commands/MergeCommand.cs b/src/cyclonedx/Commands/MergeCommand.cs index 6c61bc1..742fe33 100644 --- a/src/cyclonedx/Commands/MergeCommand.cs +++ b/src/cyclonedx/Commands/MergeCommand.cs @@ -80,11 +80,19 @@ public static async Task Merge(MergeCommandOptions options) Bom outputBom; if (options.Hierarchical) { +#if NET8_0_OR_GREATER + outputBom = CycloneDXUtils.HierarchicalMerge(inputBoms, bomSubject, MergeStrategy.Default()); +#else outputBom = CycloneDXUtils.HierarchicalMerge(inputBoms, bomSubject); +#endif } else { +#if NET8_0_OR_GREATER + outputBom = CycloneDXUtils.FlatMerge(inputBoms, MergeStrategy.Default()); +#else outputBom = CycloneDXUtils.FlatMerge(inputBoms); +#endif if (outputBom.Metadata is null) outputBom.Metadata = new Metadata(); if (bomSubject != null) {