From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7373 invoked from network); 23 Sep 2023 15:57:58 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Sep 2023 15:57:58 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1695484678; b=lorZ2Rthzx+1IfglUBPWCN9d6QHwEtk6hErGJq+FzZM0E3MnNtWP9LzzggMBpQNEFut3qrnfBC 3V4NtWJi8euYmpBB9fhkKPp0XeV6+Hx1sqng8G51QrNyfp3x2eBRKn3OeRd1i8gVUCxX9rqZUx MxrgEo2YB3mJj+jBxtu4ZfcwcZ8mX5LiOqcn5exW5LwKPBkywEVWQjwsMsmwW1230YRaZ3mheK R9NT8heanB2JIC7BtlSOsFCU7hF52sy4mrOHRX3NMGFHuRokTm/MaOYKS+8sBTmNeahCR24aSC 8BAU4DqDYYz6HxzOjcrK1DSWgaP6lIv3rMa77rbK2f232w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1695484678; bh=TN2fW2/tV31OfVz0DfaYXlvbC/ooJWQpZN2auueff3Q=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=hObHLCvPetW5A8Or/fm/RUnrVHOjvsUMcnqZpgd4II0VN93KKMWEH9TPNUd9b/ep97IFwwR05t mv9ne0Qj83Pk/mXt3Yglm46gcpK7Zz8Guh/GMrNmtfoskWd1VQd0907teJqR7BZTAxDtv+e1q2 /kLy2guC9fnTwiUtJbNXoUW3t7neNd90sDhZMDS7qVfALsBYXXlTImmAVysMIdorvtJ23Ih4U9 LhdKSSHF7neX7yWTUQe5cDLFpu3RtMyRCREq6hxdxUhXT6wAkIRXbolDvsI3Ybs9Doug58Lmbd z8th51GBis0+7uN3Cm+2ZqfPRP9kGgBclGScbFmjr4sN5w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ZgmVaC5oTA7j/enBbDnMvx6gz0Q/ZZ4k55XrLoHDe0U=; b=N3slMOEz2N/UVS2YuwNtv6fn/g i5Dj0ZCVuRuKwWnoAWZm0AIwRHUcTjSKdwidwVpieshOo+eWpzYpOY6n51XxYQlWBzZXuieNbmYyA NunD0ihko36g0FGp96Wkvj53WbYQFwBmRvdGcx6DvSJw4D2UEJGymeP3t1zug8QCoDiGwVkHeQmaH i8QUe2/BFwjZCxOz2gsr/T6+3Zh+YekWHXs+1+NfJpvxujwROWWXTLObHStWXFpl0pUbXi1Hyrogi 83ibX5v76RubE+a7B/eieaqs6VEJ6+Vh2vlEG/mw/cnpMwPgXI10rZBgtJFqv07zM+emXPWb9qbam a6oFz+hA==; Received: by zero.zsh.org with local id 1qk514-0006NU-9n; Sat, 23 Sep 2023 15:57:58 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-lj1-f171.google.com ([209.85.208.171]:51218) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qk50m-00063g-8B; Sat, 23 Sep 2023 15:57:41 +0000 Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2c038a1e2e6so58282541fa.2 for ; Sat, 23 Sep 2023 08:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1695484659; x=1696089459; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZgmVaC5oTA7j/enBbDnMvx6gz0Q/ZZ4k55XrLoHDe0U=; b=NBqpY9+g2ibQW17yAHFkFaWvPrBzs4fUFWr1j7PRmT99W9xTS21pqDKnmnC7Hclhs1 PYLorlwTqp+HZ1u6AwdM4Hof4B5LIxreT38i9t/RipA057X7DI5EPC1j0lpGCXP6iaHS 9lcgsXYBUjb6txrGRhrZhxqznGN9VUOstPdyEWeibqg8afmjv12RBhFrb6AnguG76G3b tnywsu4tQUbWIe33YSLLp0UMwTgNNr71JRUIOmHDzsj5heF1pxz7KUKxVJvq99K3p02R VWnaxsLPsHmHyaOs3ftPZwLJOAkov07YsQ4s0E2nRG2mn56pi2eZjafOgXqOmWaLCox5 D+iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695484659; x=1696089459; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZgmVaC5oTA7j/enBbDnMvx6gz0Q/ZZ4k55XrLoHDe0U=; b=elNvV/z6G+EBMH8DXhqaXEGflXsfXLla7+AsJWBSERJ3Ca+k/XaSTGnMuOZdzcXLVL BX8POoogAIq3MGzXNWBCPFfzELbMWD/a/CxnKBGiV+eYCYiyHLRY+F3oFbEZBKwoVHKW KBL0RPft1HFFQrc4IsHurSKNkTVj5olPBmoTDMd8qskiZke5uEij8cD4ZIDjNh5m7Biv RD9+tui3nJFVjAj4jKEXI2GJHBbvRhNHUDjF0HQNqQoLq6NPViBO3XbbIlPaz50LTvFx ZQ0hB61BH/XLz31FuT/sqy3qr/nZndd+4um4YcGqzKVcfwn0+zNsyZiE56tH657DdPiX ktPg== X-Gm-Message-State: AOJu0YxRvPp4pDHL0kX7oHhBqdxlsu+V10+5XIM+GXxLJFe3UX+NBEgZ e8gGAVN7d39g3uvByrIv2azES12M+keO3IhUeJvMqA== X-Google-Smtp-Source: AGHT+IGsHP0oMBjZkw7Lj55l0Ks7t4us5gU3VZ9ERLt8bk74CAYD/pjytjW3l4jeR4ym1NwOgTRZivcxH6THPENbor4= X-Received: by 2002:a2e:8752:0:b0:2b9:53bd:47a7 with SMTP id q18-20020a2e8752000000b002b953bd47a7mr2046487ljj.30.1695484659054; Sat, 23 Sep 2023 08:57:39 -0700 (PDT) MIME-Version: 1.0 References: <76b5e42c740593dc2598514175203d8e3f9bd6ef.1685555157.git.joerg@jo-so.de> <38862-1695249714.491344@RvQZ.ZQmW.9EO8> <20230923071652.sw5x35fqddzz473f@jo-so.de> In-Reply-To: <20230923071652.sw5x35fqddzz473f@jo-so.de> From: Bart Schaefer Date: Sat, 23 Sep 2023 10:57:28 -0500 Message-ID: Subject: Re: [PATCH v2] run-help for docker, perf, podman, ssh, svnadmin To: =?UTF-8?B?SsO2cmcgU29tbWVy?= Cc: Oliver Kiddle , zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52184 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Sat, Sep 23, 2023 at 2:17=E2=80=AFAM J=C3=B6rg Sommer w= rote: > > Oliver Kiddle schrieb am Do 21. Sep, 00:41 (+0200): > > The other was 51746 which did elicit a couple of less than enthusiastic > > replies. > > I guess you talk about =E2=80=9Crun-help: Support variables in aliases=E2= =80=9D. This > discussion was entrenched and no solution was found. Returning to that below ... meanwhile: > I still have the > problem of > > ``` > % unalias run-help > % autoload run-help > % alias tt1=3D'LC_ALL=3DC true' tt2=3Dtrue > % run-help tt2 > tt2 is an alias for true > % run-help tt1 > tt1 is an alias for LC_ALL=3DC true > LC_ALL=3DC not found > No manual entry for LC_ALL=3DC > ``` This works for me in the current dev version, that is, after workers/51593 is applied. What continues not to work is your original example of an alias that invokes another alias, where the first alias is nothing but an assignment: > zenbook% alias LCC=3D'LC_ALL=3DC'; alias T=3D'LCC true' > zenbook% run-help T > No manual entry for T > ``` (the above excerpted from the message quoted below) On Thu, 18 May 2023 08:52:21 +0200 J=C3=B6rg Sommer wrote: > > Bart Schaefer schrieb am Wed 17. May, 15:45 (-0700): > > # 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? I'm leaning toward this being the way to go. However, in retrospect, Marlon's trick for skipping leading assignments, etc., begins to look more ad-hoc than necessary. I suspect we should instead disassemble the command with ${(z)...} and look at the arguments one by one. > zenbook% alias LCC=3D'LC_ALL=3DC'; alias T=3D'LCC true' This is going to be a messy problem either way because this looks like a command named "LCC" that happens to take an argument "true". The only way for run-help to discover that it should be invoking help for "true" is to recursively expand all aliases before analyzing the command line ... but in that case it can't report "... is an alias for ...". I would more likely expect this -- > zenbook% run-help T -- to at best respond with something like -- T is an alias for LCC true LCC is an alias for LC_ALL=3DC -- and then stop. > > 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? To start with, an additional flag to ${(Z+opts+)var} that would expand aliases could be very helpful. Other than that, the suggestion above to use (z) or one of it's variations (do we handle both possible settings of interactivecomments?) might make it easier to search for command words.