bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: when options conflict


From: Tony Abou-Assaleh
Subject: Re: when options conflict
Date: Sat, 20 May 2006 03:16:40 -0300 (ADT)

I am in partial agreement here, mostly due to the lack of knowledge in
POSIX and GNU guidelines.

I agree that overriding creates complexity and should be avoided. But I
also see value in allowing overriding. When you have some common options
set in the environment variable or as an alias to grep, and you want to
change some of them in a particular execution, it is convenient to
override the options as desired, rather than changing the environment or
fully specifying all options.

The added complexity is for the maintainers maybe even more so than to the
users, since we need to decide what to allow, what not, and when to warn.
However, I'd like our decision to be primarily based on the user's
convenience, and find a way to manage to the maintenance task.

Also important that we attempt to minimize divergence from existing
behaviour that some systems may depend on.

Cheers,

TAA

-----------------------------------------------------
Tony Abou-Assaleh
Lecturer, Computer Science Department
Brock University, St. Catharines, ON, Canada, L2S 3A1
Office: MC J215
Tel:    +1(905)688-5550 ext. 5243
Fax:    +1(905)688-3255
Email:  address@hidden
WWW:    http://www.cosc.brocku.ca/~taa/
----------------------[THE END]----------------------

On Fri, 19 May 2006, Paul Eggert wrote:

> Benno Schulenberg <address@hidden> writes:
>
> > Yes, but it would be simpler to also make it a silent override.
> > Having several different mechanisms makes the baviour of grep's
> > command line less transparent to the user.
>
> I disagree.  The general rule for POSIX and GNU utilities is that the
> order of options should not matter.
>
> Ideally options are independent of each other, and users can specify
> them in any order with no confusion.
>
> Sometimes one option implies another.  In that case, order should not
> matter either.  For example, if -x implies -w, then it shouldn't
> matter which order the user specifies: once the user specifies -x,
> then whether -w is also specified is logically irrelevant.
>
> Sometimes two options are incompatible.  In these cases, it is
> sometimes useful to have otherwise-incompatible options override each
> other.  But this should be limited.  It's normally better to report an
> error to a user who specifies incompatible options, as such a user is
> requesting impossible behavior.
>
> Grep has many options, and we should be wary about documenting or
> supporting complicated interactions among them.  Complexity like that
> generally causes more problems than it cures.
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]