Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global flag not implemented #1045

Closed
dvgitit opened this issue Mar 10, 2023 · 3 comments
Closed

global flag not implemented #1045

dvgitit opened this issue Mar 10, 2023 · 3 comments

Comments

@dvgitit
Copy link

dvgitit commented Mar 10, 2023

  • Task version: v3.21.0 (h1:pVGAGXxJ9Pk5mvjqv/CsdAD4ZIzNMjF+vrXMueM/WFk=)
  • Operating System: Ubuntu 20.04.5 LTS

Symptoms

error message: unknown flag: --global or unknown shorthand flag: 'g' in -g

The global flag (-g | --global) according to Running a global Taskfile is not implemented.

Case with --global flag

$ task --global
unknown flag: --global
Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [--taskfile] [--dry] [--summary] [task...]

Runs the specified task(s). Falls back to the "default" task if no task name
was specified, or lists all tasks if an unknown task name was specified.

Example: 'task hello' with the following 'Taskfile.yml' file will generate an
'output.txt' file with the content "hello".

'''
version: '3'
tasks:
  hello:
    cmds:
      - echo "I am going to write a file named 'output.txt' now."
      - echo "hello" > output.txt
    generates:
      - output.txt
'''

Options:
  -c, --color                       colored output. Enabled by default. Set flag to false or use NO_COLOR=1 to disable (default true)
  -C, --concurrency int             limit number tasks to run concurrently
  -d, --dir string                  sets directory of execution
  -n, --dry                         compiles and prints tasks in the order that they would be run, without executing them
  -x, --exit-code                   pass-through the exit code of the task command
  -f, --force                       forces execution even when the task is up-to-date
  -h, --help                        shows Task usage
  -i, --init                        creates a new Taskfile.yaml in the current folder
  -I, --interval duration           interval to watch for changes
  -j, --json                        formats task list as json
  -l, --list                        lists tasks with description of current Taskfile
  -a, --list-all                    lists tasks with or without a description
  -o, --output string               sets output style: [interleaved|group|prefixed]
      --output-group-begin string   message template to print before a task's grouped output
      --output-group-end string     message template to print after a task's grouped output
  -p, --parallel                    executes tasks provided on command line in parallel
  -s, --silent                      disables echoing
      --status                      exits with non-zero exit code if any of the given tasks is not up-to-date
      --summary                     show summary about a task
  -t, --taskfile string             choose which Taskfile to run. Defaults to "Taskfile.yml"
  -v, --verbose                     enables verbose mode
      --version                     show Task version
  -w, --watch                       enables watch of the given task
unknown flag: --global

Case with -g flag

$ task -g
unknown shorthand flag: 'g' in -g
Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [--taskfile] [--dry] [--summary] [task...]

Runs the specified task(s). Falls back to the "default" task if no task name
was specified, or lists all tasks if an unknown task name was specified.

Example: 'task hello' with the following 'Taskfile.yml' file will generate an
'output.txt' file with the content "hello".

'''
version: '3'
tasks:
  hello:
    cmds:
      - echo "I am going to write a file named 'output.txt' now."
      - echo "hello" > output.txt
    generates:
      - output.txt
'''

Options:
  -c, --color                       colored output. Enabled by default. Set flag to false or use NO_COLOR=1 to disable (default true)
  -C, --concurrency int             limit number tasks to run concurrently
  -d, --dir string                  sets directory of execution
  -n, --dry                         compiles and prints tasks in the order that they would be run, without executing them
  -x, --exit-code                   pass-through the exit code of the task command
  -f, --force                       forces execution even when the task is up-to-date
  -h, --help                        shows Task usage
  -i, --init                        creates a new Taskfile.yaml in the current folder
  -I, --interval duration           interval to watch for changes
  -j, --json                        formats task list as json
  -l, --list                        lists tasks with description of current Taskfile
  -a, --list-all                    lists tasks with or without a description
  -o, --output string               sets output style: [interleaved|group|prefixed]
      --output-group-begin string   message template to print before a task's grouped output
      --output-group-end string     message template to print after a task's grouped output
  -p, --parallel                    executes tasks provided on command line in parallel
  -s, --silent                      disables echoing
      --status                      exits with non-zero exit code if any of the given tasks is not up-to-date
      --summary                     show summary about a task
  -t, --taskfile string             choose which Taskfile to run. Defaults to "Taskfile.yml"
  -v, --verbose                     enables verbose mode
      --version                     show Task version
  -w, --watch                       enables watch of the given task
unknown shorthand flag: 'g' in -g

Case of actual run with global flag

$ ls $HOME/Taskfile.y*ml && cat $HOME/Taskfile.y*ml && ls ./Taskfile.y*ml || task --version && task -g
/home/myhome/Taskfile.yaml
# https://taskfile.dev

version: '3'

vars:
  GREETING: Hello, World!

tasks:
  default:
    cmds:
      - echo "{{.GREETING}}"
    silent: true
ls: cannot access './Taskfile.y*ml': No such file or directory
Task version: v3.21.0 (h1:pVGAGXxJ9Pk5mvjqv/CsdAD4ZIzNMjF+vrXMueM/WFk=)
unknown shorthand flag: 'g' in -g
Usage: task [-ilfwvsd] [--init] [--list] [--force] [--watch] [--verbose] [--silent] [--dir] [--taskfile] [--dry] [--summary] [task...]

Runs the specified task(s). Falls back to the "default" task if no task name
was specified, or lists all tasks if an unknown task name was specified.

Example: 'task hello' with the following 'Taskfile.yml' file will generate an
'output.txt' file with the content "hello".

'''
version: '3'
tasks:
  hello:
    cmds:
      - echo "I am going to write a file named 'output.txt' now."
      - echo "hello" > output.txt
    generates:
      - output.txt
'''

Options:
  -c, --color                       colored output. Enabled by default. Set flag to false or use NO_COLOR=1 to disable (default true)
  -C, --concurrency int             limit number tasks to run concurrently
  -d, --dir string                  sets directory of execution
  -n, --dry                         compiles and prints tasks in the order that they would be run, without executing them
  -x, --exit-code                   pass-through the exit code of the task command
  -f, --force                       forces execution even when the task is up-to-date
  -h, --help                        shows Task usage
  -i, --init                        creates a new Taskfile.yaml in the current folder
  -I, --interval duration           interval to watch for changes
  -j, --json                        formats task list as json
  -l, --list                        lists tasks with description of current Taskfile
  -a, --list-all                    lists tasks with or without a description
  -o, --output string               sets output style: [interleaved|group|prefixed]
      --output-group-begin string   message template to print before a task's grouped output
      --output-group-end string     message template to print after a task's grouped output
  -p, --parallel                    executes tasks provided on command line in parallel
  -s, --silent                      disables echoing
      --status                      exits with non-zero exit code if any of the given tasks is not up-to-date
      --summary                     show summary about a task
  -t, --taskfile string             choose which Taskfile to run. Defaults to "Taskfile.yml"
  -v, --verbose                     enables verbose mode
      --version                     show Task version
  -w, --watch                       enables watch of the given task
unknown shorthand flag: 'g' in -g
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Mar 10, 2023
@pd93
Copy link
Member

pd93 commented Mar 10, 2023

@dvgitit This feature was only just merged in #1029. It has not been released yet.

You'll need to wait until v3.22.0 or build Task from source if you want this functionality now.

@pd93 pd93 closed this as completed Mar 10, 2023
@task-bot task-bot removed the state: needs triage Waiting to be triaged by a maintainer. label Mar 10, 2023
@pd93 pd93 added the type: question Further information is requested. label Mar 10, 2023
@pd93
Copy link
Member

pd93 commented Mar 10, 2023

@andreynering maybe we could consider versioning the website to avoid this confusion in the future? It does seem like a lot of overhead to maintain every single released version of Task though... Perhaps we just keep the last released version (default) and tip and then copy tip into version on the release pipeline.

Alternatively, we could only deploy changes to the website on tag creation, but this would make deploying fixes harder without releasing a patch version.

@andreynering
Copy link
Member

Hi @dvgitit,

This was now just released at v3.22.0.


@pd93 I'm open to discuss improvements in that area. It seems to me that Docusaurus versioning would be easy enough to maintain. Otherwise, the idea of only publishing on new releases is valid as well.

@pd93 pd93 removed the type: question Further information is requested. label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants