Skip to content
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

[need-update] anime_regex is a wrong arg name for search command #88

Closed
bradenbest opened this issue Mar 17, 2018 · 3 comments
Closed

Comments

@bradenbest
Copy link
Contributor

When you exec mal search without an argument, it gives this:

$ mal search
usage: mal search [-h] [--extend] anime_regex
mal search: error: the following arguments are required: anime_regex

This tells me that it accepts regex. However, the actual behavior differs from the expected behavior, and acts more like a raw string search, rather than a regex search.

$ mal search boku
<long list of anime>
$ mal search b.ku # expect: baku, bbku, bcku, ...
No matches in MAL database ᕙ(⇀‸↼‶)ᕗ
$ mal search b[oua]ku # expect: boku, buku or baku
No matches in MAL database ᕙ(⇀‸↼‶)ᕗ

If it supported regex, it should at least be displaying the 50-or-so anime that the first call did. I know that there's two major standards of regex that are slightly different, so I pulled up an online python regex tester, and all of my tests worked on there.

@bradenbest bradenbest changed the title anime_regex field is broken [bug] anime_regex field is broken Mar 17, 2018
@ryukinix
Copy link
Owner

Yes, you are expecting something that mal said, but sorry, this help of argparse cli is outdated.

This behavior actually is the right thing, this is not a bug at all. However, this is a outdated args and doc, because in past search function would be what the filter function does in currently master version. Filter use a anime_regex to fetch it's own anime list after retrevied ALL of it, search use the MAL API by a global search (which doesn't have support for regex and never will have probably).

The thing to do here is just to translate anime_regex to anime_title or anything not related to regex because mal search doesn't use regex anymore since this command was renamed to mal filter after this #52

@ryukinix ryukinix changed the title [bug] anime_regex field is broken [need-update] anime_regex is a wrong arg name for search command Mar 17, 2018
@ryukinix
Copy link
Owner

@bradenbest thanks for reporting that! I really didn't saw before. That will help new comers.

@ryukinix
Copy link
Owner

BTW, we need update that old and misleading gif showing the old cli as mal search which for now is mal filter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants