zsh-workers
 help / color / mirror / code / Atom feed
From: "Jörg Sommer" <joerg@jo-so.de>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH 1/4] run-help: Support variables in aliases
Date: Thu, 18 May 2023 08:52:21 +0200	[thread overview]
Message-ID: <20230518065221.uhmbza2zw5a2jyb3@jo-so.de> (raw)
In-Reply-To: <CAH+w=7aHYfY20w5oLqhj5rvCOnO1agRfg71t0Rn5Qg=B2wC+HQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1613 bytes --]

Bart Schaefer schrieb am Wed 17. May, 15:45 (-0700):
> On Wed, May 17, 2023 at 3:13 PM Jörg Sommer <joerg@jo-so.de> wrote:
> >
> > If the alias definition starts with a variable assignment, run-help fails,
> > because it sees the variable assignment as command. Hence, skip all
> > variable assignments and noglob|nocorrect thereafter.
> 
> This may not be the right way to handle this.  The same thing is
> already being attempted in the block at
> 
>     (*)
>         if ((! didman++))
>         then
> 
> where you'll see
> 
>                 # Discard the command itself & everything before it.
> 
> so I would have expected the existing recursive call to cover it.  If
> recursion is NOT handling it, then maybe we need to pull that whole
> thing up to before the original "whence" command?

At least for me, the current code doesn't work:

```
% zsh -f
zenbook% lsb_release -d
Description:    Debian GNU/Linux 12 (bookworm)
zenbook% echo $ZSH_VERSION
5.9

zenbook% alias LCC='LC_ALL=C'; alias T='LCC true'
zenbook% run-help T
No manual entry for T
```

> Either way, we already have
> 
>     (*( is an alias for (noglob|nocorrect))*)

The patch eliminates this case, since the code to remove the variables also
belongs there.

> I repeat my earlier remarks about "reaching the point of diminishing
> returns" with our attempts to turn run-help into a full command-line
> parser.

I see. That's a fair point. What would be a better attempt to support
variables in aliases?

-- 
Dein Gesicht wird dir geschenkt. Lächeln musst du selbst! (Inga Hermann)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 269 bytes --]

  reply	other threads:[~2023-05-18  6:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 22:12 Jörg Sommer
2023-05-17 22:12 ` [PATCH 2/4] run-help-ip: Reduce the match for link to l Jörg Sommer
2023-05-17 22:12 ` [PATCH 3/4] run-help-openssl: Reduce the code Jörg Sommer
2023-05-17 22:12 ` [PATCH 4/4] run-help for docker, perf, podman, ssh, svnadmin Jörg Sommer
2023-05-31 17:45   ` [PATCH v2] " Jörg Sommer
2023-09-20 22:41     ` Oliver Kiddle
2023-09-23  7:16       ` Jörg Sommer
2023-09-23 15:57         ` Bart Schaefer
2023-09-24  7:31           ` Jörg Sommer
2023-05-17 22:45 ` [PATCH 1/4] run-help: Support variables in aliases Bart Schaefer
2023-05-18  6:52   ` Jörg Sommer [this message]
2023-05-18  9:02   ` Peter Stephenson
2023-05-23 16:25 ` [PATCH v2] run-help-openssl: Reduce code and use new manpages Jörg Sommer

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=20230518065221.uhmbza2zw5a2jyb3@jo-so.de \
    --to=joerg@jo-so.de \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).