Skip to content

Commit bdac665

Browse files
committed
Improve help text for license url template option #759
Signed-off-by: Jonathan "Jono" Yang <jyang@nexb.com>
1 parent 02da7ff commit bdac665

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/scancode/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ def validate_exclusive(ctx, exclusive_options):
363363
help='Do not return license matches with scores lower than this score. A number between 0 and 100.', group=SCANS, cls=ScanOption)
364364
@click.option('--license-text', is_flag=True, default=False,
365365
help='Include the detected licenses matched text. Has no effect unless --license is requested.', group=SCANS, cls=ScanOption)
366-
@click.option('--license-url-template', is_flag=False, default=DEJACODE_LICENSE_URL,
367-
help='Change the base URL used for "reference_url" in the scan results', group=SCANS, cls=ScanOption)
366+
@click.option('--license-url-template', is_flag=False, default=DEJACODE_LICENSE_URL, show_default=True,
367+
help='Set the template URL used for the license reference URLs. In a template URL, curly braces ({}) are replaced by the license key.', group=SCANS, cls=ScanOption)
368368
@click.option('--strip-root', is_flag=True, default=False,
369369
help='Strip the root directory segment of all paths. The default is to always '
370370
'include the last directory segment of the scanned path such that all paths have a common root directory. '

tests/scancode/data/help/help.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ Options:
2020
[default: 0]
2121
--license-text Include the detected licenses matched text. Has
2222
no effect unless --license is requested.
23-
--license-url-template TEXT Change the base URL used for "reference_url" in
24-
the scan results
23+
--license-url-template TEXT Set the template URL used for the license
24+
reference URLs. In a template URL, curly braces
25+
({}) are replaced by the license key.
26+
[default: https://enterprise.dejacode.com/urn/u
27+
rn:dje:license:{}]
2528

2629
output:
2730
--strip-root Strip the root directory segment of all paths. The

0 commit comments

Comments
 (0)