zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
Cc: zsh-users@zsh.org
Subject: Re: Safety guards for typos
Date: Mon, 24 Jan 2022 02:46:45 +0100	[thread overview]
Message-ID: <CAHYJk3TSjchUiCPCAto+7gHeXo0GUnwQA-zy6ho9EM2bybgNbA@mail.gmail.com> (raw)
In-Reply-To: <Ye3wIGuWrDpsIT2I@fullerene.field.pennock-tech.net>

On 1/24/22, Phil Pennock <zsh-workers+phil.pennock@spodhuis.org> wrote:
> So I just had a rather bad time when I didn't type a dot.
>
> Instead of:
>
>     mv *(.) old-2022-01-23/
>
> I typed:
>
>     mv *() old-2021-01-24/
>
> This created a function `mv` and a function for each entry in the
> current directory.  I should not have had a directory named `cd`, that
> was a bad call.  My Downloads area is full of cruft.
>
> Is there anything that I can turn on, in parsing, so that *() is
> interpreted as a syntax error instead of doing the globbing first and
> then defining many functions?

setopt NO_MULTI_FUNC_DEF would probably do the trick in this case,
though it will also prevent explicitly saying mv cp ln() { whatever }.

-- 
Mikael Magnusson


  reply	other threads:[~2022-01-24  1:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  0:17 Phil Pennock
2022-01-24  1:46 ` Mikael Magnusson [this message]
2022-01-24  2:01   ` Phil Pennock
2022-01-24  2:11   ` Phil Pennock
2022-01-24  2:51     ` Bart Schaefer
2022-01-24  5:57 ` Daniel Shahaf

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=CAHYJk3TSjchUiCPCAto+7gHeXo0GUnwQA-zy6ho9EM2bybgNbA@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-users@zsh.org \
    --cc=zsh-workers+phil.pennock@spodhuis.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).