Skip to content

Support asterisk matching in aliases #1988

@NorbertHauriel

Description

@NorbertHauriel
Contributor

Description

Below is my feature request, see the comments inside the taskfile:

version: "3"

tasks:
  echo-*:
    aliases:
      - e* # should pass the .MATCH argument
    vars:
      TEXT: "{{index .MATCH 0}}"
    cmds:
      - echo {{.TEXT}}

  run-*-*:
    aliases:
      - r*-* # should pass the .MATCH arguments
      - r # should be illegal
      - r* # should be illegal
    vars:
      ARG_1: "{{index .MATCH 0}}"
      ARG_2: "{{index .MATCH 1}}"
    cmds:
      - echo {{.ARG_1}} {{.ARG_2}}

EDIT:
This is a duplicate because the original issue had a very different title and I was not sure whether it had relevance to this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @NorbertHauriel@pd93@task-bot

        Issue actions

          Support asterisk matching in aliases · Issue #1988 · go-task/task