File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,13 @@ Arguments:
67
67
68
68
Options:
69
69
--output-format=OUTPUT-FORMAT Which output format to use.
70
- {choices: "XML ", "JSON "} [default: "XML"]
70
+ {choices: "JSON ", "XML "} [default: "XML"]
71
71
--output-file=OUTPUT-FILE Path to the output file.
72
72
Set to "-" to write to STDOUT [default: "-"]
73
73
--omit=OMIT Omit dependency types.
74
74
{choices: "dev", "plugin"} (multiple values allowed)
75
75
--spec-version=SPEC-VERSION Which version of CycloneDX spec to use.
76
- {choices: "1.4 ", "1.3 ", "1.2 ", "1.1 "} [default: "1.4"]
76
+ {choices: "1.1 ", "1.2 ", "1.3 ", "1.4 "} [default: "1.4"]
77
77
--output-reproducible|--no-output-reproducible Whether to go the extra mile and make the output reproducible.
78
78
This might result in loss of time- and random-based-values.
79
79
--validate|--no-validate Validate the resulting output.
Original file line number Diff line number Diff line change @@ -102,8 +102,10 @@ class Options
102
102
/**
103
103
* @param scalar[] $values
104
104
*/
105
- private static function formatChoice (array $ values ): string
105
+ private static function formatChoice (array $ values, int $ sortFlag = \ SORT_STRING ): string
106
106
{
107
+ sort ($ values , $ sortFlag );
108
+
107
109
return '{choices: " ' .
108
110
implode ('", " ' , $ values ).
109
111
'"} ' ;
@@ -147,7 +149,7 @@ public function getDefinition(): InputDefinition
147
149
null ,
148
150
InputOption::VALUE_REQUIRED ,
149
151
'Which version of CycloneDX spec to use. ' .\PHP_EOL .
150
- self ::formatChoice (array_keys (self ::VALUE_SPEC_VERSION_MAP )),
152
+ self ::formatChoice (array_keys (self ::VALUE_SPEC_VERSION_MAP ), \ SORT_NUMERIC ),
151
153
array_search ($ this ->specVersion , self ::VALUE_SPEC_VERSION_MAP , true ),
152
154
array_keys (self ::VALUE_SPEC_VERSION_MAP )
153
155
),
You can’t perform that action at this time.
0 commit comments