libubox: add convenience function for adding anonymous strings to array container
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 32
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing _json_add_generic helper and related JSON convenience functions. Check how the current cursor is handled for array containers, then verify that anonymous strings can be appended using the requested helper without changing existing named-string behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100