Skip to content

Commit 775f0d6

Browse files
authored
fix: set AllowMultipleArgumentsPerToken for List<string> based CLI options to true. fixes #433 (#434)
fixes #433 Signed-off-by: MTsfoni <[email protected]>
1 parent 4b8a8ae commit 775f0d6

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/cyclonedx/Commands/Add/AddFilesCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public static void Configure(System.CommandLine.Command rootCommand)
4545
subCommand.Add(new Option<CycloneDXBomFormat>("--input-format", "Specify input file format."));
4646
subCommand.Add(new Option<CycloneDXBomFormat>("--output-format", "Specify output file format."));
4747
subCommand.Add(new Option<string>("--base-path", "Base path for directory to process (defaults to current working directory if omitted)."));
48-
subCommand.Add(new Option<List<string>>("--include", "Apache Ant style path and file patterns to specify what to include (defaults to all files, separate patterns with a space)."));
49-
subCommand.Add(new Option<List<string>>("--exclude", "Apache Ant style path and file patterns to specify what to exclude (defaults to none, separate patterns with a space)."));
48+
subCommand.Add(new Option<List<string>>("--include", "Apache Ant style path and file patterns to specify what to include (defaults to all files, separate patterns with a space).") { AllowMultipleArgumentsPerToken = true});
49+
subCommand.Add(new Option<List<string>>("--exclude", "Apache Ant style path and file patterns to specify what to exclude (defaults to none, separate patterns with a space).") { AllowMultipleArgumentsPerToken = true });
5050
subCommand.Handler = CommandHandler.Create<AddFilesCommandOptions>(AddFiles);
5151
rootCommand.Add(subCommand);
5252
}

src/cyclonedx/Commands/MergeCommand.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,18 @@ public static class MergeCommand
3131
public static void Configure(RootCommand rootCommand)
3232
{
3333
Contract.Requires(rootCommand != null);
34-
var subCommand = new System.CommandLine.Command("merge", "Merge two or more BOMs");
35-
subCommand.Add(new Option<List<string>>("--input-files", "Input BOM filenames (separate filenames with a space)."));
36-
subCommand.Add(new Option<string>("--output-file", "Output BOM filename, will write to stdout if no value provided."));
37-
subCommand.Add(new Option<CycloneDXBomFormat>("--input-format", "Specify input file format."));
38-
subCommand.Add(new Option<CycloneDXBomFormat>("--output-format", "Specify output file format."));
39-
subCommand.Add(new Option<SpecificationVersion>("--output-version", "Specify output BOM specification version."));
40-
subCommand.Add(new Option<bool>("--hierarchical", "Perform a hierarchical merge."));
41-
subCommand.Add(new Option<string>("--group", "Provide the group of software the merged BOM describes."));
42-
subCommand.Add(new Option<string>("--name", "Provide the name of software the merged BOM describes (required for hierarchical merging)."));
43-
subCommand.Add(new Option<string>("--version", "Provide the version of software the merged BOM describes (required for hierarchical merging)."));
34+
var subCommand = new System.CommandLine.Command("merge", "Merge two or more BOMs")
35+
{
36+
new Option<List<string>>("--input-files", "Input BOM filenames (separate filenames with a space).") { AllowMultipleArgumentsPerToken = true },
37+
new Option<string>("--output-file", "Output BOM filename, will write to stdout if no value provided."),
38+
new Option<CycloneDXBomFormat>("--input-format", "Specify input file format."),
39+
new Option<CycloneDXBomFormat>("--output-format", "Specify output file format."),
40+
new Option<SpecificationVersion>("--output-version", "Specify output BOM specification version."),
41+
new Option<bool>("--hierarchical", "Perform a hierarchical merge."),
42+
new Option<string>("--group", "Provide the group of software the merged BOM describes."),
43+
new Option<string>("--name", "Provide the name of software the merged BOM describes (required for hierarchical merging)."),
44+
new Option<string>("--version", "Provide the version of software the merged BOM describes (required for hierarchical merging).")
45+
};
4446
subCommand.Handler = CommandHandler.Create<MergeCommandOptions>(Merge);
4547
rootCommand.Add(subCommand);
4648
}

0 commit comments

Comments
 (0)