Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14408 > unrolled thread

Re: shopt help possibly wrong

Started byChet Ramey <chet.ramey@case.edu>
First post2018-07-27 10:19 -0400
Last post2018-07-27 09:59 -0700
Articles 2 — 2 participants

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: shopt help possibly wrong Chet Ramey <chet.ramey@case.edu> - 2018-07-27 10:19 -0400
    Re: shopt help possibly wrong hugogabriel.eyherabide@gmail.com - 2018-07-27 09:59 -0700

#14408 — Re: shopt help possibly wrong

FromChet Ramey <chet.ramey@case.edu>
Date2018-07-27 10:19 -0400
SubjectRe: shopt help possibly wrong
Message-ID<mailman.4331.1532701240.1292.bug-bash@gnu.org>
On 7/27/18 7:00 AM, Hugo Gabriel Eyherabide wrote:

> Bash Version: 4.3
> Patch Level: 48
> Release Status: release
> 
> Description:
>         After reading the documentation in "help shopt" I attempted to set
> flags, for example, noclobber, by using "shopt -s noclobber", but got an
> error message. I've found that I can do that by using "shopt -s -o
> -noclobber" but that the help provided me no indication that the additional
> "-o" was actually necessary.
> 
> Repeat-By:
>         Using "shopt -s noclobber" (or any optname) instead of "shopt -s -o
> noclobber).

There is a set of option names for use by `set -o' (mostly the ones
corresponding to `set' options and those defined by POSIX) and a bash-
specific set available for use with `shopt'. Read the documentation to
tell the difference.

> 
> Fix:
>         I would suggest to change the help of shopt so that it says [-o
> [optname ...] ] instead of [-o] [optname ...], and change the help where
> relevant.

That would be wrong.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [next] | [standalone]


#14414

Fromhugogabriel.eyherabide@gmail.com
Date2018-07-27 09:59 -0700
Message-ID<6b864832-9b8c-4d57-8b9f-3597563cb264@googlegroups.com>
In reply to#14408
El viernes, 27 de julio de 2018, 17:20:41 (UTC+3), Chet Ramey escribió:
> On 7/27/18 7:00 AM, Hugo Gabriel Eyherabide wrote:
> 
> > Bash Version: 4.3
> > Patch Level: 48
> > Release Status: release
> > 
> > Description:
> >         After reading the documentation in "help shopt" I attempted to set
> > flags, for example, noclobber, by using "shopt -s noclobber", but got an
> > error message. I've found that I can do that by using "shopt -s -o
> > -noclobber" but that the help provided me no indication that the additional
> > "-o" was actually necessary.
> > 
> > Repeat-By:
> >         Using "shopt -s noclobber" (or any optname) instead of "shopt -s -o
> > noclobber).
> 
> There is a set of option names for use by `set -o' (mostly the ones
> corresponding to `set' options and those defined by POSIX) and a bash-
> specific set available for use with `shopt'. Read the documentation to
> tell the difference.
> 

The problem is that the documentation and the help are not entirely consistent. In particular, the help for -o stated that it 'restricts', as opposed to 'requires',  OPTNAMEs to those defined for use with `set -o'. It is not a matter of not understanding the difference between the optnames, but a matter of the help, as opposed to the documentation being ambiguous and inconsistent. Which one should be trusted then: the help or the documentation? Of course, the source code.


> > 
> > Fix:
> >         I would suggest to change the help of shopt so that it says [-o
> > [optname ...] ] instead of [-o] [optname ...], and change the help where
> > relevant.
> 
> That would be wrong.
> 

Indeed, but should have given a clue on how to solve the problem. Perhaps using [optnameposix | -o optnameset] or something else.

> -- 
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> 		 ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [prev] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web