22
22
using System . Threading . Tasks ;
23
23
using CycloneDX . Models ;
24
24
using CycloneDX . Utils ;
25
+ using System . IO ;
25
26
26
27
namespace CycloneDX . Cli . Commands
27
28
{
@@ -31,6 +32,8 @@ public static void Configure(RootCommand rootCommand)
31
32
{
32
33
Contract . Requires ( rootCommand != null ) ;
33
34
var subCommand = new Command ( "merge" , "Merge two or more BOMs" ) ;
35
+ subCommand . Add ( new Option < string > ( "--input-file-list" , "A single text file with input BOM filenames (one per line)." ) ) ;
36
+ //TBD//subCommand.Add(new Option<string>("--input-file-list0", "A single text file with input BOM filenames (separated by 0x00 characters)."));
34
37
subCommand . Add ( new Option < List < string > > ( "--input-files" , "Input BOM filenames (separate filenames with a space)." ) ) ;
35
38
subCommand . Add ( new Option < string > ( "--output-file" , "Output BOM filename, will write to stdout if no value provided." ) ) ;
36
39
subCommand . Add ( new Option < CycloneDXBomFormat > ( "--input-format" , "Specify input file format." ) ) ;
@@ -61,7 +64,12 @@ public static async Task<int> Merge(MergeCommandOptions options)
61
64
return ( int ) ExitCode . ParameterValidationError ;
62
65
}
63
66
64
- var inputBoms = await InputBoms ( options . InputFiles , options . InputFormat , outputToConsole ) . ConfigureAwait ( false ) ;
67
+ List < string > InputFiles = ( List < string > ) options . InputFiles ;
68
+ if ( options . InputFilesList != null )
69
+ {
70
+ InputFiles . AddRange ( File . ReadAllLines ( options . InputFilesList ) ) ;
71
+ }
72
+ var inputBoms = await InputBoms ( InputFiles , options . InputFormat , outputToConsole ) . ConfigureAwait ( false ) ;
65
73
66
74
Component bomSubject = null ;
67
75
if ( options . Group != null || options . Name != null || options . Version != null )
0 commit comments