-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[issue-2164] added '--tag' flag functionality #2169
base: master
Are you sure you want to change the base?
Conversation
…rnames with tags, for example "username#tag".
…g flag set would print an error many times instead of one
…ith --tag flag functionality
…ith --tag flag functionality (1)
I get the feeling that these sites would be better served by a regexCheck value that requires a discriminator, rather than a dedicated flag for it As an example... Thoughts? |
Makes sense to me to not require a dedicated flag. Only issue I see is that not all tags are necessarily 4 alnum chars, so am not sure what the regexCheck should be. |
The expression is site specific, so it can be anything I don't know the first thing about league but if I understand their requirements correctly... The only issue would be figuring how to translate this at runtime into the url format you provided (with a Edit: regex assumes that usernames use |
Possible solution to the translation issue would be to leverage match groups and then populate the url by group. This wouldn't allow for dynamic translations, but it would allow for consistent ones such as |
@Gregory-rt @roxerj Do either of you know of any sites that use discriminators where the url does something other than swap the # for a -? |
The only one I can find is https://tracker.gg/ This site supports multiple games and it handles the # by replacing it with a %23 Examples Since we are already supporting League though with the other site (which imo is better), it is not that important. I have not found a better alternative for Valorant yet. |
Created
--tag
flag which allows to search for usernames with a tag.Example usage:
sherlock sophie#1911 --tag
Tested for all exceptions and errors I could think of.
The way it works now is if you enter
sherlock sophie --tag
an error is thrown that tells user to add a tag if the tag flag is used.In a successful search, websites are filtered using a new property
isTagRequired
, and only websites that have it set toTrue
will remain in the list (isTagRequired
isFalse
by default).If the flag
--site
is used with a website that hasisTagRequired
set toTrue
but--tag
flag wasn't set, a specific error is thrown.If the flag '--site' is used with a website that has
isTagRequired
set toFalse
but--tag
flag was used, another specific error is thrown.Also searching for multiple usernames works, e.g.
sherlock sophie#1911 roxerj --tag
would return the websites found for the first username, and print an error for a username without a tag.sherlock sophie#1911 "normalus bahuras#euw" --tag
works correctly.Please let me know if you would like me to change the logic in any way.
A viable option would be to dynamically determine whether usernames have tags or not, and based on that, return results, with this option
--tag
flag would be unnecessary.