Skip to content

Commit 61483ed

Browse files
committed
Drop -c short flag from --config-file to fix click warning
The new --config-file option added in 1c04c47 declared -c as its short flag, colliding with the long-standing -c/--copyright option from the copyright scanner plugin. click warns about the duplicate parameter on every invocation: UserWarning: The parameter -c is used more than once. Remove its duplicate as parameters should be unique. Keep -c for --copyright and drop the short flag from --config-file, which has not shipped in a release yet. Regenerate the help test fixtures and update the docs pages that embed the help text. Reference: #5265 Signed-off-by: Manoj Gowda <manojgowdabs18@gmail.com>
1 parent 3c532f0 commit 61483ed

5 files changed

Lines changed: 47 additions & 49 deletions

File tree

docs/source/reference/scancode-cli/cli-help-text-options.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ The following help text is displayed for ScanCode version 32.0.0:
173173
-n, --processes INT Set the number of parallel processes to use. Disable
174174
parallel processing if 0. Also disable threading if
175175
-1. [default: (number of CPUs)-1]
176-
-c, --config-file FILENAME Path to the configuration file.
176+
--config-file FILENAME Path to the configuration file.
177177
-q, --quiet Do not print summary or progress.
178178
-v, --verbose Print progress as file-by-file path instead of a
179179
progress bar. Print verbose scan counters.

docs/source/rst-snippets/cli-core-options.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
Default: ``(number of CPUs)-1``
99

10-
-c, --config-file FILENAME Path to the configuration file.
10+
--config-file FILENAME Path to the configuration file.
1111
-v, --verbose Print verbose file-by-file progress messages.
1212

1313
-q, --quiet Do not print summary or progress messages.

src/scancode/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def default_processes():
233233
cls=PluggableCommandLineOption,
234234
)
235235

236-
@click.option('-c', '--config-file',
236+
@click.option('--config-file',
237237
type=click.File('r'),
238238
required=False,
239239
help='Path to the configuration file.',

tests/scancode/data/help/help.txt

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -136,29 +136,28 @@ Options:
136136
which are todo items and needs manual review.
137137

138138
core:
139-
--ignore <pattern> Ignore files matching <pattern>.
140-
--timeout <seconds> Stop an unfinished file scan after a timeout in
141-
seconds. [default: 120 seconds]
142-
-n, --processes INT Set the number of parallel processes to use.
143-
Disable parallel processing if 0. Also disable
144-
threading if -1. [default: (number of CPUs)-1]
145-
-c, --config-file FILENAME Path to the configuration file.
146-
-q, --quiet Do not print summary or progress.
147-
-v, --verbose Print progress as file-by-file path instead of a
148-
progress bar. Print verbose scan counters.
149-
--from-json Load codebase from one or more <input> JSON scan
150-
file(s).
151-
--max-in-memory INTEGER Maximum number of files and directories scan
152-
details kept in memory during a scan. Additional
153-
files and directories scan details above this
154-
number are cached on-disk rather than in memory.
155-
Use 0 to use unlimited memory and disable on-disk
156-
caching. Use -1 to use only on-disk caching.
157-
[default: 10000]
158-
--max-depth INTEGER Maximum nesting depth of subdirectories to scan.
159-
Descend at most INTEGER levels of directories
160-
below and including the starting directory. Use 0
161-
for no scan depth limit.
139+
--ignore <pattern> Ignore files matching <pattern>.
140+
--timeout <seconds> Stop an unfinished file scan after a timeout in
141+
seconds. [default: 120 seconds]
142+
-n, --processes INT Set the number of parallel processes to use. Disable
143+
parallel processing if 0. Also disable threading if
144+
-1. [default: (number of CPUs)-1]
145+
--config-file FILENAME Path to the configuration file.
146+
-q, --quiet Do not print summary or progress.
147+
-v, --verbose Print progress as file-by-file path instead of a
148+
progress bar. Print verbose scan counters.
149+
--from-json Load codebase from one or more <input> JSON scan
150+
file(s).
151+
--max-in-memory INTEGER Maximum number of files and directories scan details
152+
kept in memory during a scan. Additional files and
153+
directories scan details above this number are cached
154+
on-disk rather than in memory. Use 0 to use unlimited
155+
memory and disable on-disk caching. Use -1 to use
156+
only on-disk caching. [default: 10000]
157+
--max-depth INTEGER Maximum nesting depth of subdirectories to scan.
158+
Descend at most INTEGER levels of directories below
159+
and including the starting directory. Use 0 for no
160+
scan depth limit.
162161

163162
documentation:
164163
-h, --help Show this message and exit.

tests/scancode/data/help/help_linux.txt

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -138,29 +138,28 @@ Options:
138138
which are todo items and needs manual review.
139139

140140
core:
141-
--ignore <pattern> Ignore files matching <pattern>.
142-
--timeout <seconds> Stop an unfinished file scan after a timeout in
143-
seconds. [default: 120 seconds]
144-
-n, --processes INT Set the number of parallel processes to use.
145-
Disable parallel processing if 0. Also disable
146-
threading if -1. [default: (number of CPUs)-1]
147-
-c, --config-file FILENAME Path to the configuration file.
148-
-q, --quiet Do not print summary or progress.
149-
-v, --verbose Print progress as file-by-file path instead of a
150-
progress bar. Print verbose scan counters.
151-
--from-json Load codebase from one or more <input> JSON scan
152-
file(s).
153-
--max-in-memory INTEGER Maximum number of files and directories scan
154-
details kept in memory during a scan. Additional
155-
files and directories scan details above this
156-
number are cached on-disk rather than in memory.
157-
Use 0 to use unlimited memory and disable on-disk
158-
caching. Use -1 to use only on-disk caching.
159-
[default: 10000]
160-
--max-depth INTEGER Maximum nesting depth of subdirectories to scan.
161-
Descend at most INTEGER levels of directories
162-
below and including the starting directory. Use 0
163-
for no scan depth limit.
141+
--ignore <pattern> Ignore files matching <pattern>.
142+
--timeout <seconds> Stop an unfinished file scan after a timeout in
143+
seconds. [default: 120 seconds]
144+
-n, --processes INT Set the number of parallel processes to use. Disable
145+
parallel processing if 0. Also disable threading if
146+
-1. [default: (number of CPUs)-1]
147+
--config-file FILENAME Path to the configuration file.
148+
-q, --quiet Do not print summary or progress.
149+
-v, --verbose Print progress as file-by-file path instead of a
150+
progress bar. Print verbose scan counters.
151+
--from-json Load codebase from one or more <input> JSON scan
152+
file(s).
153+
--max-in-memory INTEGER Maximum number of files and directories scan details
154+
kept in memory during a scan. Additional files and
155+
directories scan details above this number are cached
156+
on-disk rather than in memory. Use 0 to use unlimited
157+
memory and disable on-disk caching. Use -1 to use
158+
only on-disk caching. [default: 10000]
159+
--max-depth INTEGER Maximum nesting depth of subdirectories to scan.
160+
Descend at most INTEGER levels of directories below
161+
and including the starting directory. Use 0 for no
162+
scan depth limit.
164163

165164
documentation:
166165
-h, --help Show this message and exit.

0 commit comments

Comments
 (0)