Skip to content

Commit f700e5f

Browse files
authored
refactor: reorder CLI switches (#876)
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent fb30ee0 commit f700e5f

File tree

2 files changed

+56
-56
lines changed

2 files changed

+56
-56
lines changed

cyclonedx_py/_internal/cli.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,6 @@ def make_argument_parser(cls, sco: ArgumentParser, **kwargs: Any) -> ArgumentPar
7676
action='store_true',
7777
dest='short_purls',
7878
default=False)
79-
op.add_argument('--outfile', # DEPRECATED
80-
metavar='<file>',
81-
help='DEPRECATED alias for "--output-file".',
82-
type=FileType('wt', encoding='utf8'),
83-
dest='output_file',
84-
default=OPTION_OUTPUT_STDOUT)
85-
op.add_argument('-o', '--output-file',
86-
metavar='<file>',
87-
help='Output file path for your SBOM'
88-
f' (set to "{OPTION_OUTPUT_STDOUT}" to output to <stdout>)'
89-
' (default: %(default)s)',
90-
type=FileType('wt', encoding='utf8'),
91-
dest='output_file',
92-
default=OPTION_OUTPUT_STDOUT)
9379
op.add_argument('--schema-version', # DEPRECATED
9480
metavar='<version>',
9581
help='DEPRECATED alias for option "--spec-version".',
@@ -100,27 +86,41 @@ def make_argument_parser(cls, sco: ArgumentParser, **kwargs: Any) -> ArgumentPar
10086
op.add_argument('--sv', '--spec-version',
10187
metavar='<version>',
10288
help='The CycloneDX spec version for your SBOM'
103-
f' {{choices: {", ".join(sorted((v.to_version() for v in SchemaVersion), reverse=True))}}}'
104-
' (default: %(default)s)',
89+
f' {{choices: {", ".join(sorted((v.to_version() for v in SchemaVersion), reverse=True))}}}'
90+
' (default: %(default)s)',
10591
dest='spec_version',
10692
choices=SchemaVersion,
10793
type=SchemaVersion.from_version,
10894
default=SchemaVersion.V1_5.to_version())
95+
op.add_argument('--output-reproducible',
96+
help='Whether to go the extra mile and make the output reproducible.\n'
97+
'This might result in loss of time- and random-based-values.',
98+
action='store_true',
99+
dest='output_reproducible',
100+
default=False)
109101
op.add_argument('--of', '--output-format',
110102
metavar='<format>',
111103
help='The output format for your SBOM'
112-
f' {choices4enum(OutputFormat)}'
113-
' (default: %(default)s)',
104+
f' {choices4enum(OutputFormat)}'
105+
' (default: %(default)s)',
114106
dest='output_format',
115107
choices=OutputFormat,
116108
type=argparse_type4enum(OutputFormat),
117109
default=OutputFormat.JSON.name)
118-
op.add_argument('--output-reproducible',
119-
help='Whether to go the extra mile and make the output reproducible.\n'
120-
'This might result in loss of time- and random-based-values.',
121-
action='store_true',
122-
dest='output_reproducible',
123-
default=False)
110+
op.add_argument('--outfile', # DEPRECATED
111+
metavar='<file>',
112+
help='DEPRECATED alias for "--output-file".',
113+
type=FileType('wt', encoding='utf8'),
114+
dest='output_file',
115+
default=OPTION_OUTPUT_STDOUT)
116+
op.add_argument('-o', '--output-file',
117+
metavar='<file>',
118+
help='Output file path for your SBOM'
119+
f' (set to "{OPTION_OUTPUT_STDOUT}" to output to <stdout>)'
120+
' (default: %(default)s)',
121+
type=FileType('wt', encoding='utf8'),
122+
dest='output_file',
123+
default=OPTION_OUTPUT_STDOUT)
124124
if BooleanOptionalAction:
125125
op.add_argument('--validate',
126126
help='Whether validate the result before outputting'

docs/usage.rst

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,24 @@ The full documentation can be issued by running with ``environment --help``:
8181
(default: application)
8282
--short-PURLs Omit all qualifiers from PackageURLs.
8383
This causes information loss in trade-off shorter PURLs, which might improve ingesting these strings.
84-
--outfile <file> DEPRECATED alias for "--output-file".
85-
-o <file>, --output-file <file>
86-
Output file path for your SBOM
87-
(set to "-" to output to STDOUT)
88-
(default: -)
8984
--schema-version <version>
9085
DEPRECATED alias for "--spec-version"
9186
--sv <version>, --spec-version <version>
9287
The CycloneDX schema version for your SBOM
9388
{choices: 1.6, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0}
9489
(default: 1.5)
90+
--output-reproducible
91+
Whether to go the extra mile and make the output reproducible.
92+
This might result in loss of time- and random-based-values.
9593
--of <format>, --output-format <format>
9694
The output format for your SBOM
9795
{choices: JSON, XML}
9896
(default: JSON)
99-
--output-reproducible
100-
Whether to go the extra mile and make the output reproducible.
101-
This might result in loss of time- and random-based-values.
97+
--outfile <file> DEPRECATED alias for "--output-file".
98+
-o <file>, --output-file <file>
99+
Output file path for your SBOM
100+
(set to "-" to output to STDOUT)
101+
(default: -)
102102
--validate, --no-validate
103103
Whether validate the result before outputting
104104
(default: True)
@@ -255,24 +255,24 @@ The full documentation can be issued by running with ``pipenv --help``:
255255
(default: application)
256256
--short-PURLs Omit all qualifiers from PackageURLs.
257257
This causes information loss in trade-off shorter PURLs, which might improve ingesting these strings.
258-
--outfile <file> DEPRECATED alias for "--output-file".
259-
-o <file>, --output-file <file>
260-
Output file path for your SBOM
261-
(set to "-" to output to <stdout>)
262-
(default: -)
263258
--schema-version <version>
264259
DEPRECATED alias for "--spec-version"
265260
--sv <version>, --spec-version <version>
266261
The CycloneDX schema version for your SBOM
267262
{choices: 1.6, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0}
268263
(default: 1.5)
264+
--output-reproducible
265+
Whether to go the extra mile and make the output reproducible.
266+
This might result in loss of time- and random-based-values.
269267
--of <format>, --output-format <format>
270268
The output format for your SBOM
271269
{choices: JSON, XML}
272270
(default: JSON)
273-
--output-reproducible
274-
Whether to go the extra mile and make the output reproducible.
275-
This might result in loss of time- and random-based-values.
271+
--outfile <file> DEPRECATED alias for "--output-file".
272+
-o <file>, --output-file <file>
273+
Output file path for your SBOM
274+
(set to "-" to output to STDOUT)
275+
(default: -)
276276
--validate, --no-validate
277277
Whether validate the result before outputting
278278
(default: True)
@@ -333,24 +333,24 @@ The full documentation can be issued by running with ``poetry --help``:
333333
(default: application)
334334
--short-PURLs Omit all qualifiers from PackageURLs.
335335
This causes information loss in trade-off shorter PURLs, which might improve ingesting these strings.
336-
--outfile <file> DEPRECATED alias for "--output-file".
337-
-o <file>, --output-file <file>
338-
Output file path for your SBOM
339-
(set to "-" to output to <stdout>)
340-
(default: -)
341336
--schema-version <version>
342337
DEPRECATED alias for "--spec-version"
343338
--sv <version>, --spec-version <version>
344339
The CycloneDX schema version for your SBOM
345340
{choices: 1.6, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0}
346341
(default: 1.5)
342+
--output-reproducible
343+
Whether to go the extra mile and make the output reproducible.
344+
This might result in loss of time- and random-based-values.
347345
--of <format>, --output-format <format>
348346
The output format for your SBOM
349347
{choices: JSON, XML}
350348
(default: JSON)
351-
--output-reproducible
352-
Whether to go the extra mile and make the output reproducible.
353-
This might result in loss of time- and random-based-values.
349+
--outfile <file> DEPRECATED alias for "--output-file".
350+
-o <file>, --output-file <file>
351+
Output file path for your SBOM
352+
(set to "-" to output to STDOUT)
353+
(default: -)
354354
--validate, --no-validate
355355
Whether validate the result before outputting
356356
(default: True)
@@ -407,24 +407,24 @@ The full documentation can be issued by running with ``requirements --help``:
407407
(default: application)
408408
--short-PURLs Omit all qualifiers from PackageURLs.
409409
This causes information loss in trade-off shorter PURLs, which might improve ingesting these strings.
410-
--outfile <file> DEPRECATED alias for "--output-file".
411-
-o <file>, --output-file <file>
412-
Output file path for your SBOM
413-
(set to "-" to output to <stdout>)
414-
(default: -)
415410
--schema-version <version>
416411
DEPRECATED alias for "--spec-version"
417412
--sv <version>, --spec-version <version>
418413
The CycloneDX schema version for your SBOM
419414
{choices: 1.6, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0}
420415
(default: 1.5)
416+
--output-reproducible
417+
Whether to go the extra mile and make the output reproducible.
418+
This might result in loss of time- and random-based-values.
421419
--of <format>, --output-format <format>
422420
The output format for your SBOM
423421
{choices: JSON, XML}
424422
(default: JSON)
425-
--output-reproducible
426-
Whether to go the extra mile and make the output reproducible.
427-
This might result in loss of time- and random-based-values.
423+
--outfile <file> DEPRECATED alias for "--output-file".
424+
-o <file>, --output-file <file>
425+
Output file path for your SBOM
426+
(set to "-" to output to STDOUT)
427+
(default: -)
428428
--validate, --no-validate
429429
Whether validate the result before outputting
430430
(default: True)

0 commit comments

Comments
 (0)