zsh-users
 help / color / mirror / code / Atom feed
* Re: zsh: bad option, bash works
       [not found] <4EEF2F30.7090404@ebi.ac.uk>
@ 2011-12-20  0:46 ` Cameron Simpson
  2011-12-20  3:54   ` Phil Pennock
  0 siblings, 1 reply; 3+ messages in thread
From: Cameron Simpson @ 2011-12-20  0:46 UTC (permalink / raw)
  To: Rich Boyce; +Cc: Community support for Fedora users, zsh-users

[ CC'd to zsh-users@zsh.org. My apologies for this. - Cameron ]

On 19Dec2011 12:33, Rich Boyce <rich@ebi.ac.uk> wrote:
| On 18/12/11 22:11, Cameron Simpson wrote:
| >On 18Dec2011 22:51, Zind<wzmindlog@gmail.com>  wrote:
| >| Thanks a trillion.   :-)
| >
| >Did you consult the manual? "man "zshbuiltins" says:
| 
| Hmm. If you're unaware that type is a builtin, when using zsh 'man
| type' actually gives me BASH_BUILTINS(1).

That is a bit of a clue right there.

| If I don't know what a
| builtin is, and read about type in there, it tells me that '-t' is a
| valid option.

Indeed. There's no particular clue that the options don't work for all
shells.

| Perhaps when you do 'man type' or any other of the builtins, you
| should be shown the man page for the shell you're actually using?

Ugh. Via the normal man command? Please not. Via some shell builtin (:-)
alias? Maybe, provided it has big flashing lwaning lights and an
indicator of how to get the "real" manual entry.

Better, maybe, would be a "help" builtin for bash, zsh etc that
documented builtins and other topics, and offered to divert to "man"
as well (or on no hit).

Hmm. I see "bash" has a help comment. Zsh doesn't.

Cheers,
-- 
Cameron Simpson <cs@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Clymer's photographs of this procedure show a very clean head. This is a lie.
There is oil in here, and lots of it. - Mike Mitten, rec.moto, 29sep1993


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zsh: bad option, bash works
  2011-12-20  0:46 ` zsh: bad option, bash works Cameron Simpson
@ 2011-12-20  3:54   ` Phil Pennock
  2011-12-20 12:03     ` Rich Boyce
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Pennock @ 2011-12-20  3:54 UTC (permalink / raw)
  To: Cameron Simpson; +Cc: Rich Boyce, Community support for Fedora users, zsh-users

On 2011-12-20 at 11:46 +1100, Cameron Simpson wrote:
> Better, maybe, would be a "help" builtin for bash, zsh etc that
> documented builtins and other topics, and offered to divert to "man"
> as well (or on no hit).
> 
> Hmm. I see "bash" has a help comment. Zsh doesn't.

zsh uses the run-help function and ZLE widget, and you can choose to
create per-builtin files at install time, or do so later and repoint
$HELPDIR to somewhere appropriate.

By default, with Emacs key-bindings, run-help is bound to Esc-H.

The RPM .spec I use at $work for building zsh does this:
----------------------------8< cut here >8------------------------------
# HELPDIR support
helpfiles=$PWD/Util/helpfiles
pushd $RPM_BUILD_ROOT%_datadir/zsh/%srcversion && {
        mkdir help && cd help && \
        man -M $RPM_BUILD_ROOT%_mandir zshbuiltins | colcrt - | perl $helpfiles
        popd
}
----------------------------8< cut here >8------------------------------

So I enter "type anything at all" at a command-prompt, enter Esc-H, get
the relevant documentation from the man-page, and *only* the relevant
documentation, for the word in the command position and when I quit the
text viewer, my command-line is still there waiting for me.

If you want:
  alias help=run-help
and you then have the help command you want.

I don't know why the HELPDIR content isn't generated by default in the
build-process, unless it's the Perl dependency.
-- 
https://twitter.com/syscomet


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zsh: bad option, bash works
  2011-12-20  3:54   ` Phil Pennock
@ 2011-12-20 12:03     ` Rich Boyce
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Boyce @ 2011-12-20 12:03 UTC (permalink / raw)
  To: Cameron Simpson, Community support for Fedora users, zsh-users

On 20/12/11 03:54, Phil Pennock wrote:
> On 2011-12-20 at 11:46 +1100, Cameron Simpson wrote:
>> Better, maybe, would be a "help" builtin for bash, zsh etc that
>> documented builtins and other topics, and offered to divert to "man"
>> as well (or on no hit).
>>
>> Hmm. I see "bash" has a help comment. Zsh doesn't.
>
> zsh uses the run-help function and ZLE widget, and you can choose to
> create per-builtin files at install time, or do so later and repoint
> $HELPDIR to somewhere appropriate.
>
> By default, with Emacs key-bindings, run-help is bound to Esc-H.
>
> The RPM .spec I use at $work for building zsh does this:
> ----------------------------8<  cut here>8------------------------------
> # HELPDIR support
> helpfiles=$PWD/Util/helpfiles
> pushd $RPM_BUILD_ROOT%_datadir/zsh/%srcversion&&  {
>          mkdir help&&  cd help&&  \
>          man -M $RPM_BUILD_ROOT%_mandir zshbuiltins | colcrt - | perl $helpfiles
>          popd
> }
> ----------------------------8<  cut here>8------------------------------
>
> So I enter "type anything at all" at a command-prompt, enter Esc-H, get
> the relevant documentation from the man-page, and *only* the relevant
> documentation, for the word in the command position and when I quit the
> text viewer, my command-line is still there waiting for me.

That's a nice fix. With stock zsh, I of course get the BASH_BUILTINS man 
page.

This seems like a bug to me, so I've filed one: 
https://bugzilla.redhat.com/show_bug.cgi?id=769264 Feel free to add your 
code as a suggested fix.

Rich


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-20 12:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4EEF2F30.7090404@ebi.ac.uk>
2011-12-20  0:46 ` zsh: bad option, bash works Cameron Simpson
2011-12-20  3:54   ` Phil Pennock
2011-12-20 12:03     ` Rich Boyce

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).