Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] cd: Append 2nd argument to CWD if 1st is empty



On Fri, Dec 1, 2023 at 7:23 PM Lawrence Velázquez <larryv@xxxxxxx> 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.




Messages sorted by: Reverse Date, Date, Thread, Author