feat: add single filter syntax help to -filters flag - #97
Merged
Conversation
Polishing the contributed per-filter help (swperb#76) before merge: - Match the exact filter NAME, not a substring of the whole usage line. The substring approach matched description text too, so e.g. `-filters V` returned 9 filters and `-filters alias` would have listed every alias. - Return a non-zero exit (1) when no filter matches, instead of printing an error to stderr but exiting 0 — keeps the 0/1/2 contract intact for scripts. - Honour --json for a single filter: emit the same [{name,syntax,description}] shape as `-filters --json`, filtered to the match (reusing split_usage). - Match house style (4-space indent), and document the `-filters [NAME]` form in --help, the README usage block, and the man page. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
|
Merged — thank you for tackling #76! 🎉 This is a genuinely useful addition for both humans and agents. I pushed a few refinements onto your branch before merging so it was fully polished, all preserving your work and the
Verified locally: clean build, 38/38 tests, and all the cases above behave correctly. Really nice contribution — the core idea was spot-on and exactly what #76 asked for. Hope to see more from you! 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #76. Added the ability to view the syntax for a specific filter by passing its name after the -filters flag (e.g., ./imgcli -filters gblur). If no filter name matches, it prints an error message to stderr.