When grep is given the options -l and -o together, or -l and -h, 
for example, then the -l option appears to take precedence and the 
other one is ignored; no warning is given.

However, when combining -dskip and -r, then the last mentioned 
option determines the outcome.  (This is useful, because when 
someone has defined GREP_OPTIONS as "-Dskip -dskip", then it is 
nice to be able to overrule this with -r on the command line.)

Ideally, what should grep do when options conflict?

1) Abort with an error message.
2) Give a warning and let an arbitrary option take precedence,
   depending on how things are implemented.
3) Say nothing and always have the last of the conflicting options
   determine the outcome.

My preference will be clear.  But maybe there is a general POSIX or 
GNU rule on what to do when options clash?

Benno


Reply via email to