Re: [PATCH] Make sure to use Araxis' "compare" and not e.g. ImageMagick's
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 23, 2012, 21:24 UTC
- Message-ID
- <7vipdejhmh.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CAHGBnuOz94YR9wx_goL5YaWzPt5Z9c3gBB9CtyfcE40F5amrXw@mail.gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
> We have no such assurance. That's why you correctly call it a > heuristics after all
ImageMagick "compare" takes "--version" and says something like this to its standard output:
$ compare --version
Version: ImageMagick 6.6.0-4 2012-05-02 Q16
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLCDoes Araxis compare take "--version" and behave in a way that is cheaply controllable? If it opens a GUI window and pops up a dialog that says "Option not understood", then it is not "controllable", but if it quickly dies with "No such option" sent to the standard error output, or sending its version string to the standard output, then we could use something like:
case "$(compare --version 2>/dev/null)" in
"Araxis compare version"*)
echo compare ;;
*)
echo "$1" ;;
esacinstead, and that would be more robust than the path based heuristics.