luci-base: improve docs for uci.get_bool
authorEric Fahlgren <[email protected]>
Wed, 12 Nov 2025 19:11:57 +0000 (11:11 -0800)
committerPaul Donald <[email protected]>
Wed, 12 Nov 2025 21:17:23 +0000 (22:17 +0100)
The get_bool function documentation was missing an option value, so
add it.  Provide a link into the developer's guide on how it's used
in scripts, for better background.

Signed-off-by: Eric Fahlgren <[email protected]>
modules/luci-base/htdocs/luci-static/resources/uci.js

index ecd5063e4ed41ad288e8ee87f05da5ce98ec9632..c0b5e97be0f11fa42d669abe8856cffc75608560 100644 (file)
@@ -711,8 +711,9 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ {
         * Many configuration files contain boolean settings, such as
         * `enabled` or `advanced_mode`, where there is no consistent
         * definition for the values.  This function allows users to
-        * enter any of the values `"yes"`, `"on"`, `"true"` or `1` in
-        * their config files and we return the expected boolean result.
+        * enter any of the values `"yes"`, `"on"`, `"true"`, `"enabled"`
+        * or `1` in their config files and we return the expected boolean
+        * result.
         *
         * Character case is not significant, so for example, any of
         * "YES", "Yes" or "yes" will be interpreted as a `true` value.
@@ -730,6 +731,10 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ {
         * @returns {boolean}
         * - Returns boolean `true` if the configuration value is defined
         *   and looks like a true value, otherwise returns `false`.
+        *
+        * See the
+        * {@link https://openwrt.org/docs/guide-developer/config-scripting#reading_booleans|Developers Guide}
+        * for more.
         */
        get_bool(conf, type, opt) {
                let value = this.get(conf, type, opt);