All,

I just upgraded to version 1.8 of Yegappan Lakshmanan's convenient 
grep.vim[1] plugin.  As part of the fix in version 1.8 for handling 
spaces in file and path names, the `--null` switch was added to xargs. 
Unfortunately, the OS X version of xargs doesn't support the long 
spelling of this argument, though it does support the short spelling, `-0`.

Could the grep.vim script be modified to use `-0` instead of `--null`? 
I believe the `-0` option is more portable than the `--null` option, 
though it doesn't seem to be universally available[2].  It is available 
on OS X and systems with GNU xargs (Linux, *BSD, ...), but a quick 
Google search indicates that it's not fully portable.  For example, 
Tom's Hardware page shows a comparison of xargs options across many 
operating systems[2].  Support for `-0` is missing on AIX and Solaris. 
The Open Group web page[3] doesn't mention the `-0` flag.

Given that the `-0` option for xargs is not universal (nor, for that 
matter, is the `-print0` option for find), perhaps the grep.vim script 
could offer a variable to configure the use of the `-print0`/`-0` 
combination.  As the script stands, users can work around the issue by 
disabling the use of xargs entirely (via the Grep_Find_Use_Xargs 
variable) but this comes at a performance penalty.

Thanks,
Michael Henry

[1]: http://www.vim.org/scripts/script.php?script_id=311
[2]: http://www.tomshardware.com/ucg/commands/xargs-15408.html
[3]: http://www.opengroup.org/onlinepubs/000095399/utilities/xargs.html

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui