HaveIBeenPwned / EmailAddressExtractor

A project to rapidly extract all email addresses from any files in a given path
BSD 3-Clause "New" or "Revised" License
64 stars 23 forks source link

Bug fixes #60

Closed GStefanowich closed 1 year ago

GStefanowich commented 1 year ago

Added some missing information to the --help flag that was present in the README.md but not the program help


Fixed #54

Fixed "Length cannot be less than 0" Exception that was being thrown. QuotesFilter checks for matching opening and closed quotes on the Username part of the address and then trims The current loose Regex considers '@domain.com a validate match, and then the filter checks if ' StartsWith ' and EndsWith ', which is true, but then trimming from 1 to 0 equals -1, which is an invalid trim. Thus the exception.


Fixed #58

Added an output message whenever a new file is opened that the file is being read

Output.Write($"Reading \"{file.FullName}\" [{ByteExtensions.Format(file.Length)}]");

The amount of lines that have been read from a file is now logged to indicate progress. I tested with 1000 or 10000 lines but currently have it set at every 25000 lines, since the read can be fairly fast.

if (lines % 25000 is 0)
    Output.Write($"Read {lines:n0} lines from \"{file.Name}\"");

If the new -q or --quiet flag is used then this message won't be written.


Created an Output class with some methods that replace the use of Console.WriteLine calls, using some of the formatting provided in #58 the current DateTime is now prefixed on messages:

private static string DateTime()
    => System.DateTime.Now.ToString(CultureInfo.CurrentCulture);

"Fixed?" #59

Any Exception occurring inside of any long-running Task will now halt all other Tasks and prompt with a Continue [y/n]? unless the --yes flag is present. If no then a TaskCancelledException is thrown on all waiting Tasks, and the program is stopped.