Skip to content

feat: add --exact flag to only match exact anime titles (#1851) - #1938

Merged
port19x merged 4 commits into
pystardust:masterfrom
emre-tiryaki:feat/exact-match-flag
Oct 4, 2026
Merged

port19x merged 4 commits into
pystardust:masterfrom
emre-tiryaki:feat/exact-match-flag

Conversation

@emre-tiryaki

Copy link
Copy Markdown
Contributor

Pull Request Template

Type of change

  • Bug fix
  • Feature
  • Documentation update

Description

This feature is asked in issue #1851

I added --exact/--exact-match style flag that filters search results to only those whose title is an exact (case-insensitive) match for the query. Useful for wrapper scripts that risk auto-selecting the wrong show when only one result comes back.

when the --exact flag is used, the program wants to given query and anime names to be an exact match(case-insensitive). If there is no exact match it says "No exact match found.".

Checklist

  • any anime playing
  • bumped version

  • next, prev, replay and select work
  • -c history and continue work
  • -d downloads work
  • -e (select episode) aka -r (range selection) works
  • -S select index works
  • -q quality works
  • -s syncplay works
  • -v vlc works
  • --dub and regular (sub) mode both work
  • --nextep-countdown countdown to next ep works

  • -h help info is up to date
  • Readme is up to date
  • Man page is up to date

Additional Testcases

(these don't block a merge)

  • --skip ani-skip works
  • --no-detach no detach works
  • --exit-after-play auto exit after playing works

Copy Pasta

./ani-cli -V
./ani-cli -S 1 -e 1 -d flcl
./ani-cli -S 1 -e 1 -q worst -v flcl
./ani-cli -c -s --dub

)

Adds --exact/--exact-match style flag that filters search results
to only those whose title is an exact (case-insensitive) match for
the query. Useful for wrapper scripts that risk auto-selecting the
wrong show when only one result comes back.

Fixes pystardust#1851
Copilot AI lite review requested due to automatic review settings September 28, 2026 14:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Preserve literal + characters when comparing exact titles.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds a case-insensitive --exact option for filtering anime search results.

Changes:

  • Implements exact-title matching and no-match handling.
  • Updates help text and version to 5.1.5.
  • Documents the option in the man page.

The exact-match logic incorrectly treats literal + characters as spaces, preventing valid titles such as C++ from matching.

File Description
ani-cli Implements the new flag and filtering logic.
ani-cli.1 Documents the --exact option.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ani-cli Outdated
@port19x

port19x commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Ah you made a new one.
Could you make it an environment variable instead?
ANI_CLI_EXACT

@emre-tiryaki

Copy link
Copy Markdown
Contributor Author

@port19x I made the change you requested.

Before: ani-cli --exact "Jujutsu Kaisen"
After ANI_CLI_EXACT=1 ani-cli "Jujutsu Kaisen"

@port19x port19x left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image Does not work for titles containing a space

@emre-tiryaki

Copy link
Copy Markdown
Contributor Author

Sorry for the inconvenience. I was testing with double quotes, did not test without it.

@emre-tiryaki
emre-tiryaki force-pushed the feat/exact-match-flag branch from 873ac30 to 6b5b06c Compare October 1, 2026 15:17
@emre-tiryaki
emre-tiryaki requested a review from port19x October 2, 2026 15:50
@port19x

port19x commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Tested successfully, thanks for the PR
Screenshot 2026-10-04 at 16 10 44

@port19x
port19x merged commit e2120b9 into pystardust:master Oct 4, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: --exact flag to only match if exact full string is found (for wrapper scripts)

3 participants