sherlock icon indicating copy to clipboard operation
sherlock copied to clipboard

Added functionality for Sherlock to lookup usernames that begin with a hyphen.

Open tjhasan opened this issue 1 year ago • 1 comments

Closes issue #1375.

The reason why this problem exists in the first place is because of argparser not being able to differentiate valid arguments for positional args vs invalid arguments. The solution is to encase the argument in quotations. For example '-username'.

However, there is a bug in which arguments passed this way, while containing a leading (-) was still read as an invalid argument. You can read about the discussion here and here.

So for now, the only real solution is to instruct the user to submit any usernames with hyphens as follows: ' -username'.

I've added a few lines of code that strips the leading white-space character so that the lookup does not result in errors.

tjhasan avatar Jul 16 '22 23:07 tjhasan

A much more elegant solution might be to force all usernames to be encased in quotations, but that felt too intrusive to the current code so I'll leave that decision to the maintainers.

tjhasan avatar Jul 17 '22 00:07 tjhasan

This can be fixed by running Sherlock with the quotes around the username: python3 -- sherlock "-username"

sdushantha avatar Feb 04 '23 17:02 sdushantha