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 Friday, December 1st, 2023 at 10:21, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
>
> What is the use case of the new behavior?

I often work in directories that are named the same with one having an extra
suffix. Examples would be ./dotfiles and ./dotfiles-private, or ./repo and
./repo-branchname where repo-branchname is a linked git-worktree of repo to work
in different branches simultaneously.
To switch from repo-branchname to repo, I can type `cd -branchname ''`. The
inverse does currently not work though; I'd have to type
`cd ../repo-branchname`.

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. But this might very
well be biased by my usage.

Thanks,
Julian

Attachment: signature.asc
Description: OpenPGP digital signature



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