Skip to content

Commit 55106b3

Browse files
committed
Add option for hiding the progress bar
1 parent 25190d7 commit 55106b3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/fosslight_scanner/_help.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Options:
1515
-h\t\t\t\t\t Print help message
1616
-r\t\t\t\t\t Keep raw data
17+
-t\t\t\t\t\t Hide the progress bar
1718
-s <source_path>\t\t\t Path to analyze source
1819
-w <link>\t\t\t\t Link to be analyzaed can be downloaded by wget or git clone
1920
-o <output>\t\t\t\t Output directory or file

src/fosslight_scanner/fosslight_scanner.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,11 @@ def main():
202202
output_dir = _executed_path
203203
output_file = ""
204204
output_file_or_dir = ""
205+
show_progressbar = True
205206

206207
try:
207208
argv = sys.argv[1:]
208-
opts, args = getopt.getopt(argv, 'hrs:d:a:o:w:')
209+
opts, args = getopt.getopt(argv, 'htrs:d:a:o:w:')
209210
except getopt.GetoptError:
210211
print_help_msg()
211212

@@ -227,6 +228,8 @@ def main():
227228
output_file_or_dir = arg
228229
elif opt == "-r":
229230
remove_raw_data = False
231+
elif opt == "-t":
232+
show_progressbar = False
230233

231234
try:
232235
if output_file_or_dir != "":
@@ -238,16 +241,16 @@ def main():
238241

239242
if not _cli_mode:
240243
src_path, dep_path, dep_arguments, url_to_analyze = get_input_mode()
241-
timer = TimerThread()
242-
timer.setDaemon(True)
243-
timer.start()
244+
if show_progressbar:
245+
timer = TimerThread()
246+
timer.setDaemon(True)
247+
timer.start()
244248

245249
if url_to_analyze != "":
246250
run_after_download_source(url_to_analyze, output_dir, remove_raw_data, output_file)
247251
elif src_path != "" or dep_path != "":
248252
run(src_path, dep_path,
249253
dep_arguments, output_dir, remove_raw_data, False, True, {}, output_file)
250-
251254
except Exception as ex:
252255
logger.warning(str(ex))
253256

0 commit comments

Comments
 (0)