GNU bug report logs - #13120
expand/unexpand: streamline first-only/initial options

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: Todd Shandelman <todd.shandelman@HIDDEN>; dated Fri, 7 Dec 2012 21:24:03 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Changed bug title to 'expand/unexpand: streamline first-only/initial options' from 'Not quite a bug, but ...' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 13120 <at> debbugs.gnu.org:


Received: (at 13120) by debbugs.gnu.org; 9 Dec 2012 12:35:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 09 07:35:20 2012
Received: from localhost ([127.0.0.1]:33672 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Thg6J-0000DF-VV
	for submit <at> debbugs.gnu.org; Sun, 09 Dec 2012 07:35:20 -0500
Received: from mx1.redhat.com ([209.132.183.28]:50667)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <P@HIDDEN>) id 1Thg6H-0000D8-Q6
	for 13120 <at> debbugs.gnu.org; Sun, 09 Dec 2012 07:35:19 -0500
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB9CYlDe027666
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sun, 9 Dec 2012 07:34:47 -0500
Received: from [10.36.116.39] (ovpn-116-39.ams2.redhat.com [10.36.116.39])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id qB9CYiCN029031
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sun, 9 Dec 2012 07:34:46 -0500
Message-ID: <50C48564.4040400@HIDDEN>
Date: Sun, 09 Dec 2012 12:34:44 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: Todd Shandelman <todd.shandelman@HIDDEN>
Subject: Re: bug#13120: Not quite a bug, but ...
References: <CAFB8h=bR0-uz5O=MVASnciFSxAiwDLJuZK13sgkPs1LEV35m-Q@HIDDEN>
In-Reply-To: <CAFB8h=bR0-uz5O=MVASnciFSxAiwDLJuZK13sgkPs1LEV35m-Q@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	qB9CYlDe027666
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 13120
Cc: 13120 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

On 12/07/2012 08:23 PM, Todd Shandelman wrote:
> Hi,  bug-coreutils@HIDDEN  -
>
> Not quite a bug, but why does the same option, essentially, have two ve=
ry
> different names in the 'expand' and 'unexpand'  utilities?
>
> This is confusing and hampers convenient usage.
>
> I am referring to* --initial* in the one case and* --first-only* in the
> other.
>
> See below.
>
> Or what am I missing?

Yes that is inconsistent.
Interestingly the POSIX defined expand and unexpand are inconsistent
in relation to this to start with.

unexpand only processes leading blanks by default, but
expand processes all blanks by default.

So unexpand needs the -a option to process all blanks,
and expand needs the -i, --initial option to process only leading blanks.

Given the above you might think that the --first-only option to unexpand
is redundant.  However -a is implied by -t (as per POSIX), therefore
to really limit to initial blanks, you need this option.

So as for naming.  I agree that --first-only is inconsistent.
It's also a bit ambiguous. Does it mean only the first tab is written,
or all leading blanks are processed.  Now deprecating --first-only
for the more consistent --initial has some cost.  For example
it would break part of my FSlint program:
http://code.google.com/p/fslint/source/browse/trunk/fslint/supprt/rmlint/=
fix_ws.sh
Also, I see busybox copied --first-only into its unexpand implementation.
But I guess to be forward looking --first-only should be deprecated
in favor of --initial?

thanks,
P=C3=A1draig.




Information forwarded to bug-coreutils@HIDDEN:
bug#13120; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Dec 2012 21:23:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 07 16:23:46 2012
Received: from localhost ([127.0.0.1]:59356 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Th5Ob-0004oE-8d
	for submit <at> debbugs.gnu.org; Fri, 07 Dec 2012 16:23:46 -0500
Received: from eggs.gnu.org ([208.118.235.92]:40944)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <todd.shandelman@HIDDEN>) id 1Th4SY-0003Qz-AQ
	for submit <at> debbugs.gnu.org; Fri, 07 Dec 2012 15:23:47 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <todd.shandelman@HIDDEN>) id 1Th4SB-0000MJ-Fl
	for submit <at> debbugs.gnu.org; Fri, 07 Dec 2012 15:23:26 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	HTML_MESSAGE,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable
	version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:49649)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <todd.shandelman@HIDDEN>) id 1Th4SB-0000MF-CP
	for submit <at> debbugs.gnu.org; Fri, 07 Dec 2012 15:23:23 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52283)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <todd.shandelman@HIDDEN>) id 1Th4S8-00053c-6q
	for bug-coreutils@HIDDEN; Fri, 07 Dec 2012 15:23:23 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <todd.shandelman@HIDDEN>) id 1Th4S2-0000Kv-95
	for bug-coreutils@HIDDEN; Fri, 07 Dec 2012 15:23:20 -0500
Received: from mail-wi0-f173.google.com ([209.85.212.173]:37824)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <todd.shandelman@HIDDEN>) id 1Th4S1-0000KR-Tv
	for bug-coreutils@HIDDEN; Fri, 07 Dec 2012 15:23:14 -0500
Received: by mail-wi0-f173.google.com with SMTP id hn17so1440402wib.12
	for <bug-coreutils@HIDDEN>; Fri, 07 Dec 2012 12:23:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=h6kE1WXLvR8Fc6vsS86DgPrDUN8KbJf7sMGS4WXy3fI=;
	b=N0XuR8e6+PdVzZnHSlFAgro30Vzs6e2KfnclUAvVjRXUZAJ5vQTsctsCWec43+nswU
	lBIRTUXNC9OBJ8AiZIMOYs4KZWJi25gh+C1LclGJuAsTGoAfYeDIRy2BgqT8jcONJPB0
	9VANrAkSi4BrpoMMkcPgfIJVPT90q9fRpT0rtO4cnprNTqC+4UyY87z+PuhjImenOegA
	bJk8674xNP/1pBW9gL5UVDXH/D6DFoON374GDgJlAgPzTswHlBwD+J62YHtZHD467vbB
	KaTo3WrTj3r/NAvS2PvBpAX8DlOwXVkSrtfZNyzYhtcvERfnuBnsbTTVOWOvOI0XiDRR
	ChdQ==
MIME-Version: 1.0
Received: by 10.216.200.137 with SMTP id z9mr2818780wen.184.1354911792120;
	Fri, 07 Dec 2012 12:23:12 -0800 (PST)
Received: by 10.194.139.40 with HTTP; Fri, 7 Dec 2012 12:23:12 -0800 (PST)
Date: Fri, 7 Dec 2012 14:23:12 -0600
Message-ID: <CAFB8h=bR0-uz5O=MVASnciFSxAiwDLJuZK13sgkPs1LEV35m-Q@HIDDEN>
Subject: Not quite a bug, but ...
From: Todd Shandelman <todd.shandelman@HIDDEN>
To: bug-coreutils@HIDDEN
Content-Type: multipart/alternative; boundary=0016e6d99a3112449b04d048fcf1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 07 Dec 2012 16:23:43 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.4 (---)

--0016e6d99a3112449b04d048fcf1
Content-Type: text/plain; charset=UTF-8

Hi,  bug-coreutils@HIDDEN  -

Not quite a bug, but why does the same option, essentially, have two very
different names in the 'expand' and 'unexpand'  utilities?

This is confusing and hampers convenient usage.

I am referring to* --initial* in the one case and* --first-only* in the
other.

See below.

Or what am I missing?

Thanks.

Todd Shandelman
Houston, TX

############################################################################################

* expand --help*
Usage: expand [OPTION]... [FILE]...
Convert tabs in each FILE to spaces, writing to standard output.
With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
  -i, --initial       do not convert tabs after non blanks
  -t, --tabs=NUMBER   have tabs NUMBER characters apart, not 8
  -t, --tabs=LIST     use comma separated list of explicit tab positions
      --help     display this help and exit
      --version  output version information and exit

Report bugs to <bug-coreutils@HIDDEN>.

$ *unexpand --help*
Usage: unexpand [OPTION]... [FILE]...
Convert blanks in each FILE to tabs, writing to standard output.
With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
  -a, --all        convert all blanks, instead of just initial blanks
      --first-only convert only leading sequences of blanks (overrides -a)
  -t, --tabs=N     have tabs N characters apart instead of 8 (enables -a)
  -t, --tabs=LIST  use comma separated LIST of tab positions (enables -a)
      --help     display this help and exit
      --version  output version information and exit

Report bugs to <bug-coreutils@HIDDEN>.

--0016e6d99a3112449b04d048fcf1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div>Hi, =C2=A0<a href=3D"mailto:bug-coreutils@HIDDEN">bug-coreutils@HIDDEN=
rg</a> =C2=A0-</div><div><br></div>Not quite a bug, but why does the same o=
ption, essentially, have two very different names in the &#39;expand&#39; a=
nd &#39;unexpand&#39; =C2=A0utilities?<div>
<br></div><div>This is confusing and hampers convenient usage.<br><div><br>=
<div>I am referring to<b> --initial</b> in the one case and<b> --first-only=
</b> in the other.<br><div><br></div><div>See below.</div><div><br><div>
Or what am I missing?<br><div><br></div><div>Thanks.</div><div><br></div><d=
iv>Todd Shandelman</div><div>Houston, TX</div><div><div><br></div><div>####=
###########################################################################=
#############</div>
<div><br></div><div><div><b>=C2=A0expand --help</b></div><div>Usage: expand=
 [OPTION]... [FILE]...</div><div>Convert tabs in each FILE to spaces, writi=
ng to standard output.</div><div>With no FILE, or when FILE is -, read stan=
dard input.</div>
<div><br></div><div>Mandatory arguments to long options are mandatory for s=
hort options too.</div><div><span style=3D"background-color:rgb(255,255,51)=
">=C2=A0 -i, --initial =C2=A0 =C2=A0 =C2=A0 do not convert tabs after non b=
lanks</span></div>
<div>=C2=A0 -t, --tabs=3DNUMBER =C2=A0 have tabs NUMBER characters apart, n=
ot 8</div><div>=C2=A0 -t, --tabs=3DLIST =C2=A0 =C2=A0 use comma separated l=
ist of explicit tab positions</div><div>=C2=A0 =C2=A0 =C2=A0 --help =C2=A0 =
=C2=A0 display this help and exit</div><div>=C2=A0 =C2=A0 =C2=A0 --version =
=C2=A0output version information and exit</div>
<div><br></div><div>Report bugs to &lt;<a href=3D"mailto:bug-coreutils@gnu.=
org">bug-coreutils@HIDDEN</a>&gt;.</div><div><br></div><div>$ <b>unexpand =
--help</b></div><div>Usage: unexpand [OPTION]... [FILE]...</div><div>Conver=
t blanks in each FILE to tabs, writing to standard output.</div>
<div>With no FILE, or when FILE is -, read standard input.</div><div><br></=
div><div>Mandatory arguments to long options are mandatory for short option=
s too.</div><div>=C2=A0 -a, --all =C2=A0 =C2=A0 =C2=A0 =C2=A0convert all bl=
anks, instead of just initial blanks</div>
<div>=C2=A0 =C2=A0 =C2=A0 <span style=3D"background-color:rgb(255,255,51)">=
--first-only convert only leading sequences of blanks (overrides -a)</span>=
</div><div>=C2=A0 -t, --tabs=3DN =C2=A0 =C2=A0 have tabs N characters apart=
 instead of 8 (enables -a)</div>
<div>=C2=A0 -t, --tabs=3DLIST =C2=A0use comma separated LIST of tab positio=
ns (enables -a)</div><div>=C2=A0 =C2=A0 =C2=A0 --help =C2=A0 =C2=A0 display=
 this help and exit</div><div>=C2=A0 =C2=A0 =C2=A0 --version =C2=A0output v=
ersion information and exit</div><div><br></div><div>
Report bugs to &lt;<a href=3D"mailto:bug-coreutils@HIDDEN">bug-coreutils@g=
nu.org</a>&gt;.</div><div><br></div></div><div><br></div></div></div></div>=
</div></div></div>

--0016e6d99a3112449b04d048fcf1--




Acknowledgement sent to Todd Shandelman <todd.shandelman@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#13120; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.