Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expand: improve support for array keys and values #893

Merged
merged 1 commit into from
Jul 3, 2022
Merged

Conversation

mvdan
Copy link
Owner

@mvdan mvdan commented Jun 29, 2022

(see commit message)

Fixes #884.

That is, add support for "${array[@]}" for associative arrays,
as well as "{!array[@]}" for indexed and associative arrays.

We also add support for positional parameters in indirections,
so that ${!@}, ${!*}, and ${!1} work the same as Bash.

As usual, with plenty of tests.

Fixes #884.
@mvdan
Copy link
Owner Author

mvdan commented Jun 29, 2022

cc @everactivetim @ghostsquad

@everactivetim
Copy link

Thanks @mvdan! I've confirmed the branch outputs the expected results locally.

@mvdan mvdan merged commit b37fb54 into master Jul 3, 2022
@mvdan mvdan deleted the 884-arrays branch July 3, 2022 15:04
@andreynering
Copy link
Collaborator

Thanks @mvdan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug for associative arrays when using gosh with -c vs without
4 participants