Skip to content

Commit cf12239

Browse files
authored
Merge pull request docker#10207 from ndeloof/tail_n
alias -n for --tail to align with docker CLI
2 parents df70735 + 33c3f4d commit cf12239

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

cmd/compose/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func logsCommand(p *ProjectOptions, streams api.Streams, backend api.Service) *c
5656
flags.BoolVar(&opts.noColor, "no-color", false, "Produce monochrome output.")
5757
flags.BoolVar(&opts.noPrefix, "no-log-prefix", false, "Don't print prefix in logs.")
5858
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps.")
59-
flags.StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs for each container.")
59+
flags.StringVarP(&opts.tail, "tail", "n", "all", "Number of lines to show from the end of the logs for each container.")
6060
return logsCmd
6161
}
6262

docs/reference/compose_logs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ View output from containers
1111
| `--no-color` | | | Produce monochrome output. |
1212
| `--no-log-prefix` | | | Don't print prefix in logs. |
1313
| `--since` | `string` | | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
14-
| `--tail` | `string` | `all` | Number of lines to show from the end of the logs for each container. |
14+
| `-n`, `--tail` | `string` | `all` | Number of lines to show from the end of the logs for each container. |
1515
| `-t`, `--timestamps` | | | Show timestamps. |
1616
| `--until` | `string` | | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
1717

docs/reference/docker_compose_logs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ options:
4747
kubernetes: false
4848
swarm: false
4949
- option: tail
50+
shorthand: "n"
5051
value_type: string
5152
default_value: all
5253
description: |

0 commit comments

Comments
 (0)