1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

Add subcommand list to task module (#1039)

Could use some polish, but with this, after

```nu
use .../task.nu
```

the command `task` exists and will output this

```console
$ task
╭─────────────────────────┬───────────────────────────────────────────────────────────────────────────╮
│ task clean              │ Remove tasks from the status list.                                        │
│ task edit               │ Edit the command, path or label of a stashed or queued task.              │
│ task group              │ Use this to add or remove groups.                                         │
│ task group add          │ Create a new group with a name.                                           │
│ task group remove       │ Remove a group with a name.                                               │
│ task kill               │ Kill specific running tasks or whole task groups.                         │
│ task log                │ Display the output of tasks.                                              │
│ task pause              │ Either pause a running tasks or a specific groups of tasks.               │
│ task queue              │ Queue stashed tasks for execution.                                        │
│ task remove             │ Remove tasks from the queue.                                              │
│                         │ Running or paused tasks need to be killed first.                          │
│ task restart            │ Restart failed or successful task(s).                                     │
│ task send               │ Send something to a task. Useful for sending confirmations such as "y\n". │
│ task set-parallel-limit │ Set the maximum parallel tasks for a group.                               │
│ task shutdown           │ Shutdown pueue and thus this module.                                      │
│ task spawn              │ Spawn a task to run in the background, even when the shell is closed.     │
│ task start              │ Resume operation of specific tasks or groups of tasks.                    │
│ task stash              │ Stash a task that is not currently running.                               │
│ task status             │ Display the current status of all tasks.                                  │
│ task switch             │ Switches the queue position of two tasks.                                 │
│                         │ Only works for queued or stashed tasks.                                   │
│ task wait               │ Wait until the provided tasks are finished.                               │
╰─────────────────────────┴───────────────────────────────────────────────────────────────────────────╯
```
This commit is contained in:
Philipp A. 2025-02-08 13:50:44 +01:00 committed by GitHub
parent 5b95311c2d
commit ee7422a12a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -432,3 +432,11 @@ export def set-parallel-limit [
pueue parallel ...$args $max
}
const HERE = (path self)
export def main [] {
let mod_name = $HERE | path basename | str replace -r '\.nu$' ''
scope commands | where name =~ $"^($mod_name) " | select name description | transpose -rd
}