felangel / felangel/mason

feat: Limiting var values

Offen
#849 3 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @felangel Auf GitHub ansehen
documentation
Vorherrschende Sprache
Dart
Sterne
1.1k
Forks
113
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**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.
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.