Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh: bad option, bash works



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



Messages sorted by: Reverse Date, Date, Thread, Author