handle no-color flag

pull/1218/head
Noah-20 3 years ago
parent a3e2f7c214
commit ad029d9ec6

@ -23,6 +23,7 @@ from result import QueryStatus
from result import QueryResult from result import QueryResult
from notify import QueryNotifyPrint from notify import QueryNotifyPrint
from sites import SitesInformation from sites import SitesInformation
from colorama import init
module_name = "Sherlock: Find Usernames Across Social Networks" module_name = "Sherlock: Find Usernames Across Social Networks"
__version__ = "0.14.0" __version__ = "0.14.0"
@ -583,7 +584,14 @@ def main():
if args.tor or args.unique_tor: if args.tor or args.unique_tor:
print("Using Tor to make requests") print("Using Tor to make requests")
print("Warning: some websites might refuse connecting over Tor, so note that using this option might increase connection errors.") print("Warning: some websites might refuse connecting over Tor, so note that using this option might increase connection errors.")
if args.no_color:
# Disable color output.
init(strip=True, convert=False)
else:
# Enable color output.
init(autoreset=True)
# Check if both output methods are entered as input. # Check if both output methods are entered as input.
if args.output is not None and args.folderoutput is not None: if args.output is not None and args.folderoutput is not None:
print("You can only use one of the output methods.") print("You can only use one of the output methods.")
@ -640,8 +648,7 @@ def main():
# Create notify object for query results. # Create notify object for query results.
query_notify = QueryNotifyPrint(result=None, query_notify = QueryNotifyPrint(result=None,
verbose=args.verbose, verbose=args.verbose,
print_all=args.print_all, print_all=args.print_all)
color=not args.no_color)
# Run report on all specified users. # Run report on all specified users.
for username in args.username: for username in args.username:

Loading…
Cancel
Save