New completion for ImageMagick 7 (magick command)#165
Open
robbyrob42 wants to merge 1 commit intozsh-users:masterfrom
Open
New completion for ImageMagick 7 (magick command)#165robbyrob42 wants to merge 1 commit intozsh-users:masterfrom
robbyrob42 wants to merge 1 commit intozsh-users:masterfrom
Conversation
Add _magick completion for ImageMagick 7.1, which unifies all tools under the `magick` command. This completes alongside the existing _imagemagick which covers ImageMagick 6. Features: - Completes magick and all legacy tool names (convert, identify, mogrify, composite, compare, montage, stream, display, animate, import, conjure) - Subcommand dispatch: `magick identify`, `magick compare`, etc. each get tool-specific options - Bare `magick` usage (convert-style) gets the full option set - Enum value completion for colorspace, compose, compress, filter, gravity, metric, morphology, distort, evaluate, and more - File completion filtered to common image formats with fallback - Version guard via _pick_variant: falls back to _files on IM6 so it coexists safely with _imagemagick - _call_function hooks for user-overridable subcommand completions
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.
ImageMagick 7 unified all tools under a single
magickcommand, replacing the standalone binaries from IM6 (convert, identify, mogrify, etc.). The existing_imagemagickcompletion covers IM6 but has no support for themagickcommand or IM7's option set.This adds
_magickwhich:magickand all legacy tool names via#compdefmagick <tool>subcommands (identify, compare, etc.) to tool-specific option setsmagick [options...] input output(convert-style) usagemagick -helpandmagick -listoutput_pick_variantto detect IM7 and falls back to_fileson IM6, so it coexists safely with_imagemagick_call_functionhooks for user-overridable subcommand completionsTested against ImageMagick 7.1.2-17 on macOS (Homebrew). Follows the completion style guide conventions.
Note:
_imagemagickand_magickboth register#compdeffor the legacy binary names (convert, identify, etc.). On systems with IM7, the zsh maintainers may want to decide how to handle the overlap — e.g., updating_imagemagickto defer to_magickwhen IM7 is detected, or deprecating_imagemagickin favor of this file.