Skip to content

Commit 24c4e89

Browse files
committed
docs: compose logs: add links for since/until flag descriptions
Link to the corresponding `docker container logs` equivalents, which contain more details on the accepted formats and use. The container logs documentation still needs some updates to provide per-flag sections, so follow-ups can be made once those are done. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 40a2262 commit 24c4e89

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

cmd/compose/logs.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"errors"
2222

23+
"github.com/docker/cli-docs-tool/annotation"
2324
"github.com/docker/cli/cli/command"
2425
"github.com/spf13/cobra"
2526

@@ -63,7 +64,9 @@ func logsCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *Backe
6364
flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output")
6465
flags.IntVar(&opts.index, "index", 0, "index of the container if service has multiple replicas")
6566
flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)")
67+
flags.SetAnnotation("since", annotation.ExternalURL, []string{"https://docs.docker.com/reference/cli/docker/container/logs/"}) //nolint:errcheck
6668
flags.StringVar(&opts.until, "until", "", "Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)")
69+
flags.SetAnnotation("until", annotation.ExternalURL, []string{"https://docs.docker.com/reference/cli/docker/container/logs/#until"}) //nolint:errcheck
6770
flags.BoolVar(&opts.noColor, "no-color", false, "Produce monochrome output")
6871
flags.BoolVar(&opts.noPrefix, "no-log-prefix", false, "Don't print prefix in logs")
6972
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps")

docs/reference/compose_logs.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ Displays log output from services
55

66
### Options
77

8-
| Name | Type | Default | Description |
9-
|:---------------------|:---------|:--------|:-----------------------------------------------------------------------------------------------|
10-
| `--dry-run` | `bool` | | Execute command in dry run mode |
11-
| `-f`, `--follow` | `bool` | | Follow log output |
12-
| `--index` | `int` | `0` | index of the container if service has multiple replicas |
13-
| `--no-color` | `bool` | | Produce monochrome output |
14-
| `--no-log-prefix` | `bool` | | Don't print prefix in logs |
15-
| `--since` | `string` | | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
16-
| `-n`, `--tail` | `string` | `all` | Number of lines to show from the end of the logs for each container |
17-
| `-t`, `--timestamps` | `bool` | | Show timestamps |
18-
| `--until` | `string` | | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
8+
| Name | Type | Default | Description |
9+
|:--------------------------------------------------------------------------------|:---------|:--------|:-----------------------------------------------------------------------------------------------|
10+
| `--dry-run` | `bool` | | Execute command in dry run mode |
11+
| `-f`, `--follow` | `bool` | | Follow log output |
12+
| `--index` | `int` | `0` | index of the container if service has multiple replicas |
13+
| `--no-color` | `bool` | | Produce monochrome output |
14+
| `--no-log-prefix` | `bool` | | Don't print prefix in logs |
15+
| [`--since`](https://docs.docker.com/reference/cli/docker/container/logs/) | `string` | | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
16+
| `-n`, `--tail` | `string` | `all` | Number of lines to show from the end of the logs for each container |
17+
| `-t`, `--timestamps` | `bool` | | Show timestamps |
18+
| [`--until`](https://docs.docker.com/reference/cli/docker/container/logs/#until) | `string` | | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
1919

2020

2121
<!---MARKER_GEN_END-->

docs/reference/docker_compose_logs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ options:
5050
value_type: string
5151
description: |
5252
Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
53+
details_url: /reference/cli/docker/container/logs/
5354
deprecated: false
5455
hidden: false
5556
experimental: false
@@ -83,6 +84,7 @@ options:
8384
value_type: string
8485
description: |
8586
Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
87+
details_url: /reference/cli/docker/container/logs/#until
8688
deprecated: false
8789
hidden: false
8890
experimental: false

0 commit comments

Comments
 (0)