diff --git a/docs/yaml/objects/feature.yaml b/docs/yaml/objects/feature.yaml index 3e37644f42de..26b677f7ac80 100644 --- a/docs/yaml/objects/feature.yaml +++ b/docs/yaml/objects/feature.yaml @@ -27,11 +27,11 @@ methods: description: | Returns the feature, with `'auto'` converted to `'disabled'` if value is true. - | Feature / Condition | `value = true` | `value = false` | - | ------------------- | -------------- | --------------- | - | Enabled | Enabled | Enabled | - | Disabled | Disabled | Disabled | - | Auto | Disabled | Auto | + | Feature | `value = true` | `value = false` | + | -------- | -------------- | --------------- | + | Auto | Disabled | Auto | + | Enabled | Enabled | Enabled | + | Disabled | Disabled | Disabled | posargs: value: @@ -44,11 +44,11 @@ methods: description: | Returns the feature, with `'auto'` converted to `'enabled'` if value is true. - | Feature / Condition | `value = true` | `value = false` | - | ------------------- | -------------- | --------------- | - | Enabled | Enabled | Enabled | - | Disabled | Disabled | Disabled | - | Auto | Enabled | Auto | + | Feature | `value = true` | `value = false` | + | -------- | -------------- | --------------- | + | Auto | Enabled | Auto | + | Enabled | Enabled | Enabled | + | Disabled | Disabled | Disabled | posargs: value: @@ -63,6 +63,12 @@ methods: `'enabled'` and the value is false; a disabled feature if the object is `'auto'` or `'disabled'` and the value is false. + | Feature | `value = true` | `value = false` | + | -------- | -------------- | --------------- | + | Auto | Auto | Disabled | + | Enabled | Enabled | Error | + | Disabled | Disabled | Disabled | + example: | `require` is useful to restrict the applicability of `'auto'` features, for example based on other features or on properties of the host machine: @@ -94,6 +100,12 @@ methods: `'disabled'` and the value is true; an enabled feature if the object is `'auto'` or `'enabled'` and the value is true. + | Feature | `value = true` | `value = false` | + | -------- | -------------- | --------------- | + | Auto | Enabled | Auto | + | Enabled | Enabled | Enabled | + | Disabled | Error | Disabled | + example: | `enable_if` is useful to restrict the applicability of `'auto'` features, particularly when passing them to [[dependency]]: @@ -122,6 +134,12 @@ methods: `'enabled'` and the value is true; a disabled feature if the object is `'auto'` or `'disabled'` and the value is true. + | Feature | `value = true` | `value = false` | + | -------- | -------------- | --------------- | + | Auto | Disabled | Auto | + | Enabled | Error | Enabled | + | Disabled | Disabled | Disabled | + This is equivalent to `feature_opt.require(not condition)`, but may make code easier to reason about, especially when mixed with `enable_if`