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

Re: How to fix run-help-* functions?



On Mon, Mar 13, 2023 at 4:14 AM Michele Venturi <dardo82@xxxxxxxxx> wrote:
>
> On Tue, Mar 7, 2023, 18:41 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>
>> If you don't do the "make install" part, you get an error about a
>> "shift" count being wrong, which probably looks like a bug rather than
>> a usage problem.
>
> I've tried this but it doesn't make any difference,

When you "configure" or by passing an environment variable to "make"
you can specify a custom location for the help files.

Because run-help is a shell function, it doesn't have a "source file"
and an "object file" so the source itself contains a replacement
string @runhelpdir@ which is updated by the installfns.sh script
during "make install".  Yes, we could have put a "run-help.in" file
somewhere and processed that at a different build step to create
run-help, but that complicates installing the rest of the functions.

The help directory is populated by the Util/helpfiles script, which is
run by "make install" in the Doc subdirectory (but I do not recommend
attempting to run make in individual subdirectories rather than
letting the top-level Makefile drive it.)

However, all of that turns out to be necessary but secondary, because
the real problem is that you're using run-help wrong.

You're not intended to type out "run-help sudo" and hit enter, you're
intended to type "sudo" and then invoke the run-help ZLE widget
(normally ESC h or Alt+h), which then calls the run-help function with
some preliminary setup having been done.

Question for the audience is whether we want to consider this a bug
and make it possible to use run-help as a standalone function.




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