Skip to content

Commit

Permalink
improve writing
Browse files Browse the repository at this point in the history
  • Loading branch information
goFrendiAsgard committed Jan 14, 2024
1 parent 1a60231 commit 241bbfe
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/concepts/runner-group-and-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ task = Task(name='task')
runner.register(task)
```

To access the task, you need to run the following command in your terminal:
To access the registered Task, you need to run the following command in your terminal:

```bash
zrb task
Expand All @@ -50,22 +50,22 @@ task = Task(name='task', group=group)
runner.register(task)
```

To access the Grouped Task, you can run the following command in your terminal:
To access the registered Grouped Task, you can run the following command in your terminal:

```bash
zrb group task
```

## Limitations And Restrictions

- You can only register a task once.
- Registered tasks cannot have the same names under the same group names.
- You can only register a Task once.
- Registered Tasks cannot have the same names under the same Group names.

Let's see some examples:

### Invalid Examples

The following example is invalid because you cannot register a task twice:
The following example is invalid because you can only register a Task once:

```python
from zrb import runner, Task
Expand All @@ -87,7 +87,7 @@ task_2 = Task(name='task')
runner.register(task_2) # This yield error.
```

The following is also invalid because the Tasks shared the same name and were under the same group name.
The following is also invalid because the Tasks shared the same name and were under the same Group name.

```python
from zrb import runner, Group, Task
Expand All @@ -103,6 +103,8 @@ runner.register(task_2) # This yield error.

### Valid Examples

The following example is valid. Even though `task_1` and `task_2` shared the same name, they were defined under different Groups.

```python
from zrb import runner, Task, Group

Expand All @@ -124,7 +126,6 @@ runner.register(task_2) # OK, task_1 and task_2 are located under different grou
</p>
</div>


You can use Group to organize your Tasks. A Group will only be accessible from the CLI if at least one registered Task is under it.

You can also put a Group under another Group. Hierarchically speaking, you can think of Task Groups as directories to organize your Tasks.
Expand Down

0 comments on commit 241bbfe

Please sign in to comment.