[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Interaction between -o and the default-print
From: |
James Youngman |
Subject: |
Re: Interaction between -o and the default-print |
Date: |
Mon, 1 Nov 2004 00:00:13 +0000 |
User-agent: |
Mutt/1.3.28i |
On Sun, Oct 31, 2004 at 04:14:38PM -0700, Bob Proulx wrote:
> James Youngman wrote:
> > I have modified the findutils development code (parser.c) so that if
> > the user specifies an option after a non-option, a warning message is
> > issued. This does not occur for the -follow and -daystart options,
> > because those options affect only those tests appearing after them on
> > the command line, and to such positioning might be deliberate and
> > correct.
>
> I am sorry but I did not quite follow the description. Could you post
> an example and show how your recent change affects it? How it would
> have behaved before and now after with this change?
$ find . -mindepth 3 -ls >/dev/null
$ find . -ls -mindepth 3 >/dev/null
find: warning: you have specified the -mindepth option after a non-option
argument -ls, but options are not positional (-mindepth affects tests specified
before it as well as those specified after it). Please specify options before
other arguments.
$ find . -ls -follow >/dev/null
$
Previously, the second example would not have generated a warning
message. Apart from this warning, the output is the same before and
after the change.
I do wonder though if this attempt to be helpful will simply be
irritating. However, there are a couple of defect reports that have
been raised which would have been avoided if this error message had
been implemented. Some people do seem to assume that things like
find . \( -name foo -print \) -o \( -mindepth 2 -type d -print \)
will work, and print out instances of "foo" which are in the current
directory.
Regards,
James.