Skip to content

Commit

Permalink
Document show jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Dec 5, 2024
1 parent 3af2cd0 commit a66bba6
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- [show](row/show/index.md)
- [show status](row/show/status.md)
- [show directories](row/show/directories.md)
- [show jobs](row/show/jobs.md)
- [show cluster](row/show/cluster.md)
- [show launchers](row/show/launchers.md)
- [scan](row/scan.md)
Expand Down
59 changes: 59 additions & 0 deletions doc/src/row/show/jobs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# show jobs

Usage:
```bash
row show jobs [OPTIONS] [DIRECTORIES]
```

`row show jobs` lists submitted jobs that execute a matching action on any of the
provided directories.

## `[DIRECTORIES]`

List jobs that execute an action on one or more of the given directories. By default,
**row** shows jobs executing an action on any directory.

Pass a single `-` to read the directories from stdin (separated by newlines):
```bash
echo "dir1" | row show jobs [OPTIONS] -
```

## `[OPTIONS]`

### `--action`

(also: `-a`)

Set `--action <pattern>` to show only jobs that mach the given pattern by name.
By default, **row** shows jobs executing any action. `<pattern>` is a wildcard pattern.

### `--no-header`

Hide the header in the output.

### `--short`

Show only the job IDs.

## Examples

* Show all jobs:
```bash
row show jobs
```
* Show jobs that execute actions on any of the given directories:
```bash
row show jobs directory1 directory
```
* Show jobs that execute the action 'one':
```bash
row show jobs --action one
```
* Show jobs that execute an action starting with 'analyze':
```bash
row show jobs --action 'analyze*'
```
* Cancel SLURM jobs executing action 'two':
```bash
row show jobs --action two --short | xargs scancel
```
2 changes: 1 addition & 1 deletion doc/src/row/submit.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ the entire workspace.

(also: `-a`)

Set `--action <pattern>` to choose which actions to display by name. By default, **row**
Set `--action <pattern>` to choose which actions to submit by name. By default, **row**
submits the eligible jobs of all actions. `<pattern>` is a wildcard pattern.

### `--dry-run`
Expand Down
25 changes: 24 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,30 @@ pub enum ShowCommands {

/** Show submitted jobs.
TODO.
`row show jobs` lists submitted jobs that execute a matching action on
any of the provided directories.
EXAMPLES
* Show all jobs:
row show jobs
* Show jobs that execute actions on any of the given directories:
row show jobs directory1 directory
* Show jobs that execute the action 'one':
row show jobs --action one
* Show jobs that execute an action starting with 'analyze':
row show jobs --action 'analyze*'
* Cancel SLURM jobs executing action 'two':
row show jobs --action two --short | xargs scancel
*/
Jobs(jobs::Arguments),
}
Expand Down

0 comments on commit a66bba6

Please sign in to comment.