zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: "Lawrence Velázquez" <larryv@zsh.org>
Cc: Julian Prein <druckdev@protonmail.com>, zsh-workers@zsh.org
Subject: Re: [PATCH] cd: Append 2nd argument to CWD if 1st is empty
Date: Fri, 1 Dec 2023 19:27:19 +0100	[thread overview]
Message-ID: <CAN=4vMpXQEDRC_xqKc1JciPBvEf2ws+Zq=frsxqsa02Jw80T4w@mail.gmail.com> (raw)
In-Reply-To: <72dcfda2-9b2b-4c76-8e53-ee3332553edc@app.fastmail.com>

On Fri, Dec 1, 2023 at 7:23 PM Lawrence Velázquez <larryv@zsh.org> wrote:
>
> On Fri, Dec 1, 2023, at 8:32 AM, Julian Prein wrote:
> > My motivation to submit this patch was primarily the assumption that specifying
> > an empty argument is an edge case that is not well defined in the documentation
> > and that the current behaviour is limited in its use cases. To me an appendix
> > seems more flexible in the ways a user can utilize this.
>
> FWIW the current behavior -- while undocumented -- is aligned with
> that of ksh, and this change would break that alignment and become
> one more thing for ksh emulation to handle.

What I like about the current behavior is that it does not require
additional documentation. The existing documentation is sufficient.
What happens when the first argument is empty is consistent with what
happens when it's not: the first matching substring is replaced, which
in the case of an empty substring means the beginning of the string.
The patch changes a rare case that I don't personally care about, but
it also adds a special case, and I do care about special cases in
general -- I do not like them.

Roman.


      reply	other threads:[~2023-12-01 18:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01  3:11 Julian Prein
2023-12-01  9:21 ` Roman Perepelitsa
2023-12-01 13:32   ` Julian Prein
2023-12-01 13:51     ` Mikael Magnusson
2023-12-01 15:05       ` Julian Prein
2023-12-01 18:21     ` Lawrence Velázquez
2023-12-01 18:27       ` Roman Perepelitsa [this message]

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='CAN=4vMpXQEDRC_xqKc1JciPBvEf2ws+Zq=frsxqsa02Jw80T4w@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=druckdev@protonmail.com \
    --cc=larryv@zsh.org \
    --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).