Skip to content

zsh: Support anonymous function arguments. #1335

@zelch

Description

@zelch

I have some shell code like:

    function my-cd-rotate() {
        () {
            builtin emulate -L zsh
            while (( $#dirstack )) && ! builtin pushd -q $1 &>/dev/null; do
                builtin popd -q $1
            done
            (( $#dirstack ))
        } "$@" && reset-prompt
    }

shfmt w3.13.1 gives statements must be separated by &, ; or a newline.

You can remove the && reset-prompt and get the same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions