ryukinix / mal

MAL: A MyAnimeList Command Line Interface [BROKEN: BLAME MyAnimeList]
https://mal.readthedocs.io
Other
109 stars 9 forks source link

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

Closed bradenbest closed 6 years ago

bradenbest commented 6 years ago

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.

ryukinix commented 6 years ago

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 commented 6 years ago

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

ryukinix commented 6 years ago

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