alias -n for --tail to align with docker CLI

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2023-01-26 08:58:59 +01:00
parent aa31387355
commit 33c3f4dfad
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
3 changed files with 3 additions and 2 deletions

View File

@ -56,7 +56,7 @@ func logsCommand(p *ProjectOptions, streams api.Streams, backend api.Service) *c
flags.BoolVar(&opts.noColor, "no-color", false, "Produce monochrome output.") flags.BoolVar(&opts.noColor, "no-color", false, "Produce monochrome output.")
flags.BoolVar(&opts.noPrefix, "no-log-prefix", false, "Don't print prefix in logs.") flags.BoolVar(&opts.noPrefix, "no-log-prefix", false, "Don't print prefix in logs.")
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps.") flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps.")
flags.StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs for each container.") flags.StringVarP(&opts.tail, "tail", "n", "all", "Number of lines to show from the end of the logs for each container.")
return logsCmd return logsCmd
} }

View File

@ -11,7 +11,7 @@ View output from containers
| `--no-color` | | | Produce monochrome output. | | `--no-color` | | | Produce monochrome output. |
| `--no-log-prefix` | | | Don't print prefix in logs. | | `--no-log-prefix` | | | Don't print prefix in logs. |
| `--since` | `string` | | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) | | `--since` | `string` | | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
| `--tail` | `string` | `all` | Number of lines to show from the end of the logs for each container. | | `-n`, `--tail` | `string` | `all` | Number of lines to show from the end of the logs for each container. |
| `-t`, `--timestamps` | | | Show timestamps. | | `-t`, `--timestamps` | | | Show timestamps. |
| `--until` | `string` | | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) | | `--until` | `string` | | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |

View File

@ -47,6 +47,7 @@ options:
kubernetes: false kubernetes: false
swarm: false swarm: false
- option: tail - option: tail
shorthand: "n"
value_type: string value_type: string
default_value: all default_value: all
description: | description: |