Skip to content

Commit

Permalink
[Docs] Add options and args to run_command() docs (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy authored Jan 30, 2022
1 parent cd880de commit e6cc55f
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion website/docs/task-types/run-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ id: run-command
---

```python
run_command(name, run, parallelizable=False, deps=[])
run_command(name, run, parallelizable=False, args=[], options={}, deps=[])
```

A `run_command()` task runs the command specified in the `run` argument. The
Expand Down Expand Up @@ -54,6 +54,56 @@ task to execute while other tasks are also running.
By default, tasks are not `parallelizable`, and so Conductor will not launch a
new task until the previously launched task has completed (or failed).

### `args`

**Type:** List of primitive types (default: `[]`)

A list of ordered arguments that should be passed to the command string
specified in `run`. The arguments will be passed to the command in the order
they are listed in `args`. The primitive types supported in `args` are strings,
Booleans, integers, and floating point numbers.

#### Example

```python
run_command(
name="example",
run="./run.sh",
args=["arg1", "arg2", 123, True, 0.3],
)
```

Conductor will execute the task shown above by running `./run.sh arg1 arg2 123
true 0.3` in `bash`.

### `options`

**Type:** Dictionary mapping string keys to primitive values (default: `{}`)

A map of string keys to primitive values that should be passed to the command
string specified in `run`. Conductor treats these options as command line
"flags" and will pass them to the `run` command using `--key=value` syntax. Like
`args`, the primitive types supported in `options` are strings, Booleans,
integers, and floating point numbers. When `args` and `options` are both
non-empty, `args` are always passed first before `options`.

#### Example

```python
run_command(
name="example",
run="./run.sh",
args=["arg1"],
options={
"foo": 3,
"bar": True,
},
)
```

Conductor will execute the task shown above by running `./run.sh arg1 --foo=3
--bar=true` in `bash`.

### `deps`

**Type:** List of task identifiers (default: `[]`)
Expand Down

0 comments on commit e6cc55f

Please sign in to comment.