diff --git a/cmd/task/task.go b/cmd/task/task.go index 84ad7aa9..0ed11b64 100644 --- a/cmd/task/task.go +++ b/cmd/task/task.go @@ -108,7 +108,7 @@ func run() error { pflag.BoolVarP(&flags.list, "list", "l", false, "Lists tasks with description of current Taskfile.") pflag.BoolVarP(&flags.listAll, "list-all", "a", false, "Lists tasks with or without a description.") pflag.BoolVarP(&flags.listJson, "json", "j", false, "Formats task list as JSON.") - pflag.StringVar(&flags.taskSort, "sort", "", "Changes the order of the tasks when listed.") + pflag.StringVar(&flags.taskSort, "sort", "", "Changes the order of the tasks when listed. [default|alphanumeric|none].") pflag.BoolVar(&flags.status, "status", false, "Exits with non-zero exit code if any of the given tasks is not up-to-date.") pflag.BoolVarP(&flags.force, "force", "f", false, "Forces execution even when the task is up-to-date.") pflag.BoolVarP(&flags.watch, "watch", "w", false, "Enables watch of the given task.") diff --git a/docs/docs/api_reference.md b/docs/docs/api_reference.md index 16704d5f..9f8489ad 100644 --- a/docs/docs/api_reference.md +++ b/docs/docs/api_reference.md @@ -22,35 +22,35 @@ If `--` is given, all remaning arguments will be assigned to a special ::: -| Short | Flag | Type | Default | Description | -| ----- | --------------------------- | -------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `-c` | `--color` | `bool` | `true` | Colored output. Enabled by default. Set flag to `false` or use `NO_COLOR=1` to disable. | -| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. | -| `-d` | `--dir` | `string` | Working directory | Sets directory of execution. | -| `-n` | `--dry` | `bool` | `false` | Compiles and prints tasks in the order that they would be run, without executing them. | -| `-x` | `--exit-code` | `bool` | `false` | Pass-through the exit code of the task command. | -| `-f` | `--force` | `bool` | `false` | Forces execution even when the task is up-to-date. | -| `-g` | `--global` | `bool` | `false` | Runs global Taskfile, from `$HOME/Taskfile.{yml,yaml}`. | -| `-h` | `--help` | `bool` | `false` | Shows Task usage. | -| `-i` | `--init` | `bool` | `false` | Creates a new Taskfile.yml in the current folder. | -| `-I` | `--interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). | -| `-l` | `--list` | `bool` | `false` | Lists tasks with description of current Taskfile. | -| `-a` | `--list-all` | `bool` | `false` | Lists tasks with or without a description. | -| | `--sort` | `string` | `default` | Changes the order of the tasks when listed. | -| | `--json` | `bool` | `false` | See [JSON Output](#json-output) | -| `-o` | `--output` | `string` | Default set in the Taskfile or `intervealed` | 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. | -| | `--output-group-error-only` | `bool` | `false` | Swallow command output on zero exit code. | -| `-p` | `--parallel` | `bool` | `false` | Executes tasks provided on command line in parallel. | -| `-s` | `--silent` | `bool` | `false` | Disables echoing. | -| `-y` | `--yes` | `bool` | `false` | Assume "yes" as answer to all prompts. | -| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. | -| | `--summary` | `bool` | `false` | Show summary about a task. | -| `-t` | `--taskfile` | `string` | `Taskfile.yml` or `Taskfile.yaml` | | -| `-v` | `--verbose` | `bool` | `false` | Enables verbose mode. | -| | `--version` | `bool` | `false` | Show Task version. | -| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task. | +| Short | Flag | Type | Default | Description | +| ----- | --------------------------- | -------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `-c` | `--color` | `bool` | `true` | Colored output. Enabled by default. Set flag to `false` or use `NO_COLOR=1` to disable. | +| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. | +| `-d` | `--dir` | `string` | Working directory | Sets directory of execution. | +| `-n` | `--dry` | `bool` | `false` | Compiles and prints tasks in the order that they would be run, without executing them. | +| `-x` | `--exit-code` | `bool` | `false` | Pass-through the exit code of the task command. | +| `-f` | `--force` | `bool` | `false` | Forces execution even when the task is up-to-date. | +| `-g` | `--global` | `bool` | `false` | Runs global Taskfile, from `$HOME/Taskfile.{yml,yaml}`. | +| `-h` | `--help` | `bool` | `false` | Shows Task usage. | +| `-i` | `--init` | `bool` | `false` | Creates a new Taskfile.yml in the current folder. | +| `-I` | `--interval` | `string` | `5s` | Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid [Go Duration](https://pkg.go.dev/time#ParseDuration). | +| `-l` | `--list` | `bool` | `false` | Lists tasks with description of current Taskfile. | +| `-a` | `--list-all` | `bool` | `false` | Lists tasks with or without a description. | +| | `--sort` | `string` | `default` | Changes the order of the tasks when listed.
`default` - Alphanumeric with root tasks first
`alphanumeric` - Alphanumeric
`none` - No sorting (As they appear in the Taskfile) | +| | `--json` | `bool` | `false` | See [JSON Output](#json-output) | +| `-o` | `--output` | `string` | Default set in the Taskfile or `intervealed` | 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. | +| | `--output-group-error-only` | `bool` | `false` | Swallow command output on zero exit code. | +| `-p` | `--parallel` | `bool` | `false` | Executes tasks provided on command line in parallel. | +| `-s` | `--silent` | `bool` | `false` | Disables echoing. | +| `-y` | `--yes` | `bool` | `false` | Assume "yes" as answer to all prompts. | +| | `--status` | `bool` | `false` | Exits with non-zero exit code if any of the given tasks is not up-to-date. | +| | `--summary` | `bool` | `false` | Show summary about a task. | +| `-t` | `--taskfile` | `string` | `Taskfile.yml` or `Taskfile.yaml` | | +| `-v` | `--verbose` | `bool` | `false` | Enables verbose mode. | +| | `--version` | `bool` | `false` | Show Task version. | +| `-w` | `--watch` | `bool` | `false` | Enables watch of the given task. | ## Exit Codes