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

libubox: add convenience function for adding anonymous strings to array container #4

Open
pprindeville opened this issue Sep 3, 2023 · 2 comments

Comments

@pprindeville
Copy link
Member

It's handy to have unnamed strings in array containers, such as network.lan.ports[] in /etc/board.json.

Please add a convenience function to support this, such as:

json_add_anon_string() {
        local cur
        _json_get_var cur JSON_CUR
        _json_add_generic string "" "$1" "$cur"
}

Not sure if it's worth adding a check to see if the cursor is currently in an array or not.

@pprindeville
Copy link
Member Author

Hmm. Also a method for converting a JSON_CUR value into a path would be handy.

@pprindeville
Copy link
Member Author

Partially addressed in PR #6

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

No branches or pull requests

1 participant