Skip to content

Commit 6cff511

Browse files
committed
removed the 'exit()'. Moved the output to if block
1 parent 9ae3be8 commit 6cff511

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

check_file.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717

1818
def usage():
19-
print('[-] Usage: python check_file.py <filename1> [filename2] ... \
20-
[filenameN]')
21-
exit(0)
19+
print('[-] Usage: python check_file.py [filename1] [filename2] ... [filenameN]')
2220

2321

2422
# Readfile Functions which open the file that is passed to the script
@@ -48,14 +46,16 @@ def main():
4846
# remove non readable fileNames
4947
filenames.remove(filename)
5048
continue
49+
50+
# Read the content of each file
51+
for filename in filenames:
52+
# Display Message and read the file contents
53+
print('[+] Reading from : ' + filename)
54+
readfile(filename)
55+
5156
else:
5257
usage() # Print usage if not all parameters passed/Checked
5358

54-
# Read the content of each file
55-
for filename in filenames:
56-
# Display Message and read the file contents
57-
print('[+] Reading from : ' + filename)
58-
readfile(filename)
5959

6060
if __name__ == '__main__':
6161
main()

0 commit comments

Comments
 (0)