Eric Blake wrote:
> > I consider this a bug for two reasons:
> > 
> > 1) glibc systems use GNU getopt. It allows to mix command line options with
> >    regular arguments. The very idea of this feature is that
> >      PROG ARGS OPTIONS
> >    is equivalent to
> >      PROG OPTIONS ARGS
> 
> Only when you use the dashed form of short opts, and not the legacy
> dashless form.  This is documented in the tar manual.

The bug exists, whether I use the dashed form or the dashless form:
   $ tar -c -v -f - . -C /mnt > /dev/null
ignores the -C option.
   $ tar -c -v -f - -C /mnt . > /dev/null
correctly considers it.

> > Seen with tar-1.23 on a glibc system:
> >   $ tar cf - . -C /mnt
> > has a different effect than
> >   $ tar cf - -C /mnt .
> ...
> You probably want:
> 
> $ tar -cf - . -C /mnt

No, I certainly don't want to use "tar -cf", for two reasons documented in the
GNU tar manual:
  1) [1] says
     "all tar programs, GNU and non-GNU, support old options." (that is, the
     way of writing the main options without a dash).
  2) [2] lists a couple of cases where the dashed options lead to surprising
     behaviour.

Bruno

[1] http://www.gnu.org/software/tar/manual/html_node/Old-Options.html
[2] http://www.gnu.org/software/tar/manual/html_node/Mixing.html

Reply via email to