Skip to content

uci: add get_bool convenience function#356

Open
efahl wants to merge 1 commit into
jow-:masterfrom
efahl:uci-get-bool
Open

uci: add get_bool convenience function#356
efahl wants to merge 1 commit into
jow-:masterfrom
efahl:uci-get-bool

Conversation

@efahl

@efahl efahl commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Add 'get_bool' that adheres to the conventions defined by OpenWrt's 'config_get_bool' in /lib/functions.sh and LuCI's uci.js. Eliminates the need for users to parse and match the various strings being used to represent "true" in config files.

Link: https://openwrt.github.io/luci/jsapi/LuCI.uci.html#get_bool

Add 'get_bool' that adheres to the conventions defined by OpenWrt's
'config_get_bool' in /lib/functions.sh and LuCI's uci.js.  Eliminates
the need for users to parse and match the various strings being
used to represent "true" in config files.

Link: https://openwrt.github.io/luci/jsapi/LuCI.uci.html#get_bool
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
@jow-

jow- commented Dec 19, 2025

Copy link
Copy Markdown
Owner

Hi. The get_bool() addition is nice, thanks! The parse_bool() ones look a bit out of place though

@efahl

efahl commented Dec 19, 2025

Copy link
Copy Markdown
Contributor Author

@champtar and @feckert's use case in https://github.com/openwrt/packages/blob/45a857940cfe71573bf80541a61a0e2d1351a06a/net/mwan3/files/usr/share/rpcd/ucode/mwan3#L32 motivated parse_bool. I couldn't see any way to shove the strings back through the uci object interface there, so I exposed the internals...

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.

2 participants