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

Re: optimal expansions?



On Sat, Apr 20, 2024 at 6:24 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> On 2024-04-20 00:42, Roman Perepelitsa wrote:
>
> >
> >           print -P "%B%2F${pkg//\%/%%}%f%b"
>
> Seems we want '-r' most of the time.  And the '--' should always be there.

The missing `-r` is a bug. It should be there. The `--` in this case
is optional because the positional argument cannot start with a dash.

> To pick nits I want the leading empty line.

It's unusual for a script to print a leading empty line. It's best to
avoid doing unusual and surprising things unless you have a good
reason. In this case I would suggest not printing the leading empty
line in the script. If you need it, print it prior to the invocation:

    print && script

Roman.




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