Skip to content

Conversation

@michelhe
Copy link

@michelhe michelhe commented Apr 28, 2025

Add support for common boolean representations in environment variables beyond the standard Rust bool parsing. Now accepts various forms like:

  • True values: "y", "yes", "t", "true", "on", "1"
  • False values: "n", "no", "f", "false", "off", "0"

This makes the library more user-friendly and aligns with common expectations for environment variable configuration. Implementation draws inspiration from clap_builder and python-humanfriendly.

What did you implement:

Closes: #xxx

How did you verify your change:

Added tests for both success and error cases

What (if anything) would need to be called out in the CHANGELOG for the next release:

Add support for common boolean representations in environment variables beyond the standard Rust bool parsing. Now accepts various forms like:

  • True values: "y", "yes", "t", "true", "on", "1"
  • False values: "n", "no", "f", "false", "off", "0", ""
@michelhe michelhe force-pushed the improve-boolean branch 4 times, most recently from 29801d8 to c453db1 Compare April 29, 2025 07:44
Add support for common boolean representations in environment variables beyond the standard Rust bool parsing. Now accepts various forms like: - True values: "y", "yes", "t", "true", "on", "1" - False values: "n", "no", "f", "false", "off", "0", "" This makes the library more user-friendly and aligns with common expectations for environment variable configuration. Implementation draws inspiration from clap_builder and python-humanfriendly. Signed-off-by: Michel Heily <michelheily@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant