Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

warning: xargs: illegal option -- - #153

Open
thibaut-pro opened this issue Mar 7, 2020 · 2 comments
Open

warning: xargs: illegal option -- - #153

thibaut-pro opened this issue Mar 7, 2020 · 2 comments

Comments

@thibaut-pro
Copy link
Contributor

I get the follow warning when running the git pre-commit hook:

xargs: illegal option -- -
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
             [-L number] [-n number [-x]] [-P maxprocs] [-s size]
             [utility [argument ...]]

This is on MacOS. Any tips on how to address that?

@thibaut-pro
Copy link
Contributor Author

Replacing

# First part return the files being commited, excluding deleted files.
git diff-index -z --cached HEAD --name-only --diff-filter=ACMRTUXB |
xargs --null --no-run-if-empty git lint;

with

git lint;

in the pre-commit hook fixed it for me.

@sk-
Copy link
Owner

sk- commented Mar 11, 2020

@thibaut-singlefile Thanks for the report. It's rather hard to maintain these scripts across oses. I started the development while I was using Linux, and then there were some PRs to fix it for mac. But is not that straightforward. That is one of the reasons, I'd like to get rid of them, and instead change the CLI so that it's easier to integrate in custom hooks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants