task icon indicating copy to clipboard operation
task copied to clipboard

Do not show label instead of task name in some places like `--list`

Open ProfessorManhattan opened this issue 4 years ago • 1 comments
trafficstars

  • Task version: 3.9.0
  • Operating System: Ubuntu

Example Taskfile showing the issue

---
version: '3'

vars:
  REPOSITORY_SUBTYPE: config
  REPOSITORY_TYPE: npm

tasks:
  one:
    cmds:
      - task: two
      - pip3 install ansible

  two:
    interactive: true
    label: three
    desc: Hey
    cmds:
      - poetry env info --path
      - poetry --help
      - source "$(poetry env info --path)/bin/activate"


When assigning a label to a task, the task --list is updated with the task with the new label. However, when you attempt to run the task by running task [label_name], task fails to recognize the task.

Also, normally task alphabetizes the list shown in task --list. However, labeled items are not sorted alphabetically.

I propose that we:

  1. Allow the user to run tasks by specifying their label name (e.g. task label_name)
  2. Alphabetize the task --list with the label names included

ProfessorManhattan avatar Nov 13 '21 07:11 ProfessorManhattan

Hmm... this actually sounds like more a bug to me where the label should not be shown in same places instead of the real task name, like on --list.

We can't allow tasks to be accessible by its label because the label can contains variables. That would certainly cause problems.

andreynering avatar Nov 28 '21 19:11 andreynering