I have a tool that runs this command:
git rev-parse --path-format=absolute --git-common-dir
However its output is different depending on the git version! On older versions of git (e.g. 2.26) there is no --path-format option so it just prints out that option, like this:
$ git rev-parse --path-format=absolute --git-common-dir
--path-format=absolute
/path/to/repo/.git
On versions of git that support --path-format it works fine and only prints the second line.
How can I tell git "this is an option; please print an error if you don't understand it"? Is there something similar to how well-designed CLI tools let you do foo --option -- file.