Re: [Patch] (tiny problem) bad short_doc for % command

2019-09-21 Thread Chet Ramey
On 9/21/19 1:37 PM, Robert Elz wrote:
> Date:Sat, 21 Sep 2019 17:18:47 +0200
> From:Andreas Schwab 
> Message-ID:  <875zllu17s@igel.home>
> 
>   | A job spec already starts with %.
> 
> That's not what was meant.

It's the right answer, though.

> 
> In, for example:
> 
>   jinx$ help -s wait
>   wait: wait [-fn] [id ...]
> 
> the command name appears both before and after the ':', as if to
> say "The usage for the wait command is "wait" optional 'f' and 'n' flags,
> and some number of optional "id" args.

The job spec, introduced by the `%', *is* the command. It's explained in
the man page. Even a `%' by itself, without any job name or number, is a
job spec. So `%' is not a command name per se -- the command that gets
invoked is either `fg' or `bg'.

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



Re: [Patch] (tiny problem) bad short_doc for % command

2019-09-21 Thread Robert Elz
Date:Sat, 21 Sep 2019 17:18:47 +0200
From:Andreas Schwab 
Message-ID:  <875zllu17s@igel.home>

  | A job spec already starts with %.

That's not what was meant.

In, for example:

jinx$ help -s wait
wait: wait [-fn] [id ...]

the command name appears both before and after the ':', as if to
say "The usage for the wait command is "wait" optional 'f' and 'n' flags,
and some number of optional "id" args.

On the other hand:

jinx$ help -s %
%: job_spec [&]

whetre the '%' command name is missing.  This is actually something of
a weird case, as a command which consists entirely of a job_spec is
treated the same as the '% job_spec' command (ie: one can use either "%1"
or "% %1") so the help probably needs to be enhanced even more.

kre





Re: [Patch] (tiny problem) bad short_doc for % command

2019-09-21 Thread Andreas Schwab
On Sep 21 2019, "Christopher Chittleborough"  
wrote:

> The command "help -s %" outputs
> %: job_spec [&]
> when it should output
> %: % job_spec [&]
> because the $SHORT_DOC for "%" in builtins/reserved.def is wrong.

A job spec already starts with %.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



[Patch] (tiny problem) bad short_doc for % command

2019-09-21 Thread Christopher Chittleborough
The command "help -s %" outputs
%: job_spec [&]
when it should output
%: % job_spec [&]
because the $SHORT_DOC for "%" in builtins/reserved.def is wrong.

The attached patch fixes this.

BTW, this is not the smallest bug ever reported:
see https://sourceware.org/bugzilla/show_bug.cgi?id=21399

Cheers -- Chrisdiff -Naur bash-5.0/builtins/reserved.def bash-5.0-nonit/builtins/reserved.def
--- bash-5.0/builtins/reserved.def	2016-05-13 04:05:17.0 +1000
+++ bash-5.0-nonit/builtins/reserved.def	2019-09-21 16:25:05.465896269 +1000
@@ -175,7 +175,7 @@
 
 $BUILTIN %
 $DOCNAME fg_percent
-$SHORT_DOC job_spec [&]
+$SHORT_DOC % job_spec [&]
 Resume job in foreground.
 
 Equivalent to the JOB_SPEC argument to the `fg' command.  Resume a