[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
when options conflict
From: |
Benno Schulenberg |
Subject: |
when options conflict |
Date: |
Fri, 11 Nov 2005 22:09:17 +0100 |
User-agent: |
KMail/1.8.3 |
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
- when options conflict,
Benno Schulenberg <=