Implement long options for the sed command
Also implement the GNU extension of permitting -I and -i to lack any extension at all
Differential D2178
bin/sed: Implement long options for sed, add optional -Ii arguments eadler on Mar 31 2015, 5:09 AM. Authored by Tags None Referenced Files
Details
Diff Detail
Event Timeline
Comment Actions I am scared, not about the implementation, but about backwards compatibility. If one needs the GNU extension there is the gnu sed port (and more that 30 ports depend on it), but if we need the traditional behavior, sed in base is the only option. Apparently illumos didn't care much about it but perhaps there could be an environment variable that changes behavior to non gnu. Please have an exp ports run on this. Comment Actions This is a good point. Some configure script may try 'sed --file' (or any other flag) and then assume it is GNU Sed. Eitan can you open a PR and assign to portmgr and set the exp-run flag on it? Comment Actions sed looks broken, more than half of the ports tree didn't build. A few errors: http://pb2.nyi.freebsd.org/data/headamd64D2178-default/2015-04-12_23h59m49s/logs/errors/libXau-1.0.8_2.log Comment Actions I haven't tested it but it looks good: I do prefer splitting the patch (and I was never a fan of the optional i). BTW, we have advanced greatly in general compatibility. it would be good to see if we still need GNU sed on the 32 ports that require it currently. Comment Actions The man page and the usage message still contain optional arguments for -i and -I. Making the argument to --in-place and --in-place-separate optional (possibly by making them independent from -i/-I from getopt_long's point of view) does not break compatibility and may be a good idea. Comment Actions bah! I removed most of them, but forgot synopsis and usage
I thought about this. I think we already break compat with GNU getopt by not having a separate --separate flag. I may try and make the long options line up a bit more with GNU
|