From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Alias call in function fails...
Date: Wed, 24 Jun 2020 10:10:59 +0000 [thread overview]
Message-ID: <20200624101059.GB19280@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CAH+w=7ZMq=eh41BjiPiORz+iL1Fq1kLBS+F2Lf6DO6uaNCH3sw@mail.gmail.com>
Bart Schaefer wrote on Tue, Jun 23, 2020 at 16:40:04 -0700:
> On Tue, Jun 23, 2020 at 3:55 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> >
> > I[...] it's perhaps not self-explanatory that nl(1) is an
> > external command.
>
> You could use "cat -n" instead.
It's unportable. I'd prefer a runnable example.
How about:
[[[
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index ada69c99a..d35cad182 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -105,7 +105,13 @@ For each var(name) with a corresponding var(value), define an alias
with that value. A trailing space in var(value) causes the next word
to be checked for alias expansion. If the tt(-g) flag is present,
define a global alias; global aliases are expanded even if they do not
-occur in command position.
+occur in command position:
+
+example(% perldoc --help 2>&1 | grep 'built-in functions'
+ -f Search Perl built-in functions
+% alias -g HG='--help 2>&1 | grep'
+% perldoc HG 'built-in functions'
+ -f Search Perl built-in functions)
If the tt(-s) flag is present, define a suffix alias: if the command
word on a command line is in the form `var(text)tt(.)var(name)', where
]]]
The example uses perldoc(1) because that command is an external command,
is not system-dependent, and prints usage information to stderr when
invoked with --help.
There's already an example of «| less» in StartupFiles/zshrc:61.
Cheers,
Daniel
next prev parent reply other threads:[~2020-06-24 10:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-22 12:49 Frank Gallacher
2020-06-22 23:23 ` Mikael Magnusson
2020-06-23 8:37 ` Andreas Kusalananda Kähäri
2020-06-23 9:14 ` Peter Stephenson
2020-06-23 9:55 ` Mikael Magnusson
2020-06-23 11:28 ` Andreas Kusalananda Kähäri
2020-06-23 12:04 ` Daniel Shahaf
2020-06-23 12:46 ` Perry Smith
2020-06-23 13:10 ` Kamil Dudka
2020-06-23 16:03 ` Bart Schaefer
2020-06-23 21:14 ` Perry Smith
2020-06-23 22:54 ` Daniel Shahaf
2020-06-23 23:29 ` Perry Smith
2020-06-23 23:43 ` Bart Schaefer
2020-06-24 0:47 ` Perry Smith
2020-06-24 9:28 ` Daniel Shahaf
2020-06-24 12:55 ` Perry Smith
2020-06-23 23:40 ` Bart Schaefer
2020-06-24 10:10 ` Daniel Shahaf [this message]
2020-06-24 10:47 ` Daniel Shahaf
2020-06-24 2:58 ` Grant Taylor
2020-06-29 16:24 ` Sebastian Gniazdowski
2020-06-29 16:55 ` Bart Schaefer
2020-06-30 4:02 ` Bart Schaefer
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=20200624101059.GB19280@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=schaefer@brasslantern.com \
--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).