Skip to content

Commit e0cec32

Browse files
committed
Python: add messaging about deprecated options
1 parent 3a53787 commit e0cec32

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

python/extractor/semmle/cmdline.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ def make_parser():
102102
config_options.add_option("--colorize", dest="colorize", default=False, action="store_true",
103103
help = """Colorize the logging output.""")
104104

105+
config_options.add_option("--dont-extract-stdlib", dest="extract_stdlib", action="store_false",
106+
help="This flag is deprecated; not extracting the standard library is now the default.")
105107
config_options.add_option("--extract-stdlib", dest="extract_stdlib", default=False, action="store_true",
106108
help="Extract the standard library.")
107109

@@ -224,10 +226,18 @@ def parse(command_line):
224226
max_import_depth = float('inf')
225227
options.max_import_depth = max_import_depth
226228

229+
if 'CODEQL_EXTRACTOR_PYTHON_DONT_EXTRACT_STDLIB' in os.environ:
230+
options.extract_stdlib = False
231+
print ("Warning: CODEQL_EXTRACTOR_PYTHON_DONT_EXTRACT_STDLIB is deprecated; the default is now to not extract the standard library.")
232+
227233
if 'CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB' in os.environ:
228234
options.extract_stdlib = True
229235

230236
options.prune = True
237+
238+
if option.extract_stdlib:
239+
print ("Warning: The analysis will extract the standard library. This behavior is deprecated and will be removed in a future release. We expect it to be gone in CLI version 2.20.0.")
240+
231241
return options, args
232242

233243
def split_and_flatten(options_list, div):

0 commit comments

Comments
 (0)