zsh-users
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Cameron Simpson <cs@zip.com.au>
Cc: Rich Boyce <rich@ebi.ac.uk>,
	Community support for Fedora users
	<users@lists.fedoraproject.org>,
	zsh-users@zsh.org
Subject: Re: zsh: bad option, bash works
Date: Mon, 19 Dec 2011 22:54:20 -0500	[thread overview]
Message-ID: <20111220035420.GA38973@redoubt.spodhuis.org> (raw)
In-Reply-To: <20111220004651.GA2311@cskk.homeip.net>

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


  reply	other threads:[~2011-12-20  4:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4EEF2F30.7090404@ebi.ac.uk>
2011-12-20  0:46 ` Cameron Simpson
2011-12-20  3:54   ` Phil Pennock [this message]
2011-12-20 12:03     ` Rich Boyce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111220035420.GA38973@redoubt.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=cs@zip.com.au \
    --cc=rich@ebi.ac.uk \
    --cc=users@lists.fedoraproject.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).