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

Making run-help smart?



I wonder if run-help could be made smart by mimicking what this function does:

zman () {
    PAGER="less -g -s '+/^       "$1"'" command man zshall
}

Basically, almost always a **term** that is being documented is placed
with 7-spaces gap from beginning of the line. Try this:

zman declare

to see how it works. It's very often directly successful, sometimes it
just limits the number of search results from e.g. 47 to 3 (like for
`zman typeset'), which is still very useful. It also allows to search
for *flags*, when the letter is appended with a few (4 or more)
spaces, like so:
zman "a    "

So, `run-help declare' would be directing the user to declare's
description in manual. Would this be useful?

The `run-help typeset' would point to 3 places, but I think that an
additional logic in run-help could point the user directly to the 3rd
item, the `typeset' manual entry.

The `run-help a' would automatically append 4-5 spaces after the flag
(because it would detect that a single-letter is being queried) and
this way find direct flag entries in the manual.
-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org



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