Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Show allowed values when variable with set enum is missing #2027

@SanderKnape

Description

@SanderKnape

Description

With a task like the following:

version: '3'
tasks:
  deploy:
    cmds:
      - echo "deploying to {{.ENV}}"
    requires:
      vars:
        - name: ENV
          enum: [dev, beta, prod]

The following error will be shown when the required variable is missing:

task: Task "deploy" cancelled because it is missing required variables: ENV

When an enum is set like here, it would be great if the allowed values would be shown in the error. This way the user doesn't have to look into the Taskfile to see what values are allowed in situations where this isn't obvious.

Metadata

Metadata

Assignees

Labels

area: uiChanges related to the UI of Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions