felangel / felangel/mason

feat: Limiting var values

Open
#849 3 comments 0 reactions 1 assignee Claimed by @felangel View on GitHub
documentation
Dominant language
Dart
Stars
1.1k
Forks
113
PR merge metrics
No merged PRs in 30d

Description

**Description**

Have a way to limit the responses of values for the variable.

**Requirements**

- [ ] Include new parameter to vars called `values`.
- [ ] Fail if user inputs a value not included in the limited answer.

**Additional Context**

I might want to restrict the values set in a variable defined in the `brick.yaml` to be one of the values of an array.
Example:

```yaml
vars:
name:
type: string
values: ['Max', 'Charlie', 'Cooper'] # The possible answers.
description: Pick one of the valid names for your dog
default: Max
prompt: What is the name of your dog? # Show the default value and possible values grey out.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.