Skip to content

Extend the boolean syntax#2660

Merged
bapt merged 2 commits into
freebsd:mainfrom
dag-erling:des/parse-boolean
Apr 27, 2026
Merged

Extend the boolean syntax#2660
bapt merged 2 commits into
freebsd:mainfrom
dag-erling:des/parse-boolean

Conversation

@dag-erling

@dag-erling dag-erling commented Apr 26, 2026

Copy link
Copy Markdown
Member
  • Extend libucl's boolean parser to also accept “y” / “n”, “t” / “f”, and “1” / “0” as valid boolean values. This has also been submitted to libucl as parser: Accept more boolean values vstakhov/libucl#379.
  • Drop our own integer to boolean conversion now that libucl accepts “1” / “0”. Note that this means that e.g. “2” or “-1” would previously have been interpreted as boolean true but now results in an error message; this is considered a feature.

The current code accepts “true” / “false”, “yes” / “no”, “on” / “off”.
Extend it to also accept “y” / “n”, “t” / “f”, “1” / “0”.
Now that libucl accepts 0 / 1 as a boolean, there is no need for us to
perform this conversion ourselves.  Note that this means e.g. 2 is no
longer accepted as a boolean value, which is fine; 1 can reasonably be
interpreted as simply meaning “true”, whil2 probably indicates that the
user has misunderstood the meaning of the variable.
@bapt bapt merged commit 6ff444f into freebsd:main Apr 27, 2026
8 checks passed
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