Skip to content

Commit 9717162

Browse files
efahlsystemcrash
authored andcommitted
luci-base: improve docs for uci.get_bool
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]>
1 parent 8c2b575 commit 9717162

File tree

1 file changed

+7
-2
lines changed
  • modules/luci-base/htdocs/luci-static/resources

1 file changed

+7
-2
lines changed

modules/luci-base/htdocs/luci-static/resources/uci.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,9 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ {
711711
* Many configuration files contain boolean settings, such as
712712
* `enabled` or `advanced_mode`, where there is no consistent
713713
* definition for the values. This function allows users to
714-
* enter any of the values `"yes"`, `"on"`, `"true"` or `1` in
715-
* their config files and we return the expected boolean result.
714+
* enter any of the values `"yes"`, `"on"`, `"true"`, `"enabled"`
715+
* or `1` in their config files and we return the expected boolean
716+
* result.
716717
*
717718
* Character case is not significant, so for example, any of
718719
* "YES", "Yes" or "yes" will be interpreted as a `true` value.
@@ -730,6 +731,10 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ {
730731
* @returns {boolean}
731732
* - Returns boolean `true` if the configuration value is defined
732733
* and looks like a true value, otherwise returns `false`.
734+
*
735+
* See the
736+
* {@link https://openwrt.org/docs/guide-developer/config-scripting#reading_booleans|Developers Guide}
737+
* for more.
733738
*/
734739
get_bool(conf, type, opt) {
735740
let value = this.get(conf, type, opt);

0 commit comments

Comments
 (0)