From: zzapper <david@tvis.co.uk>
To: zsh-users@zsh.org
Subject: Re: globbing index*
Date: Mon, 7 Mar 2011 22:55:00 +0000 (UTC) [thread overview]
Message-ID: <Xns9EA1E91D648ABzzappergmailcom@80.91.229.10> (raw)
In-Reply-To: <alpine.LNX.2.01.1103071733100.2792@hp>
Benjamin R. Haskell wrote in news:alpine.LNX.2.01.1103071733100.2792@hp:
> On Mon, 7 Mar 2011, zzapper wrote:
>
>> Hi
>> I'm often diffing two files with a glob knowing that only 2 files match.
>> say index.php and index2.php
>>
>> so when I type
>>> diff index*
>> I can assume that I will get, (but it will always be as clear)
>>
>>> diff index.php index2.php
>>
>> but is there an option to force diff to output the names of actual
>> files compared?
>>
>> (Having posed myself the problem I've realized that I can always tab
>> expand)
>>
>>> diff index*<TAB>
>>
>
> Personally I prefer to keep the unexpanded form for history purposes
> (next time the glob might match different files).
>
> To output the names beforehand, you can make a function:
>
> diff () { echo "Diffing: $@" >&2 ; command diff "$@" }
>
> The 'command' precommand modifier prevents 'diff' from referring again
> to the 'function' of the same name.
>
Yep a wrapper seems the best way. My question might appear | be trivial but
the number of times I've worried which file was which!
--
zzapper
http://zzapper.co.uk/ Technical Tips
next prev parent reply other threads:[~2011-03-07 22:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-07 22:12 zzapper
2011-03-07 22:36 ` Mikael Magnusson
2011-03-07 22:38 ` Benjamin R. Haskell
2011-03-07 22:55 ` zzapper [this message]
2011-03-09 23:29 ` Wayne Davison
2011-03-09 23:56 ` Mikael Magnusson
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=Xns9EA1E91D648ABzzappergmailcom@80.91.229.10 \
--to=david@tvis.co.uk \
--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).