diff --git a/CHANGELOG.md b/CHANGELOG.md index d1f2268..89b33b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## UNRELEASED * ci: Fix php tests on macos actions runner [#110](https://github.com/jacobdeichert/mask/pull/110) +* Add choices list for flags [#111](https://github.com/jacobdeichert/mask/pull/111) ([@lovejia2022](https://github.com/lovejia2022)) ## v0.11.4 (2023-10-15) diff --git a/README.md b/README.md index f5233a9..c60ff80 100644 --- a/README.md +++ b/README.md @@ -154,11 +154,11 @@ echo "Total: $(($price * $TAX))" ~~~ ``` -If you add a `choices` list, `mask` will validate if the flag value is one of them. +Coming in v0.11.5: If you add a `choices` list, `mask` will validate if the flag value is one of them. **Example:** -`````markdown +```markdown ## print (text) > Print text with color @@ -170,11 +170,11 @@ If you add a `choices` list, `mask` will validate if the flag value is one of th * choices: RED, BLUE, GREEN * desc: Color of the text. -```sh +~~~sh COLOR=${color:RED} # Fallback to RED if not supplied echo "$COLOR: $text" +~~~ ``` -````` If you exclude the `type` field, `mask` will treat it as a `boolean` flag. If the flag is passed, its environment variable will be `"true"`, otherwise it will be unset/non-existent.