Skip to content

Conversation

@efahl
Copy link
Contributor

@efahl efahl commented Dec 18, 2025

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-
Copy link
Owner

jow- commented Dec 19, 2025

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

@efahl
Copy link
Contributor Author

efahl commented Dec 19, 2025

@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