mirror of https://github.com/docker/cli.git
Add new CLI option for --until
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
This commit is contained in:
parent
458ce53f18
commit
6f309316e2
|
@ -14,6 +14,7 @@ import (
|
||||||
type logsOptions struct {
|
type logsOptions struct {
|
||||||
follow bool
|
follow bool
|
||||||
since string
|
since string
|
||||||
|
until string
|
||||||
timestamps bool
|
timestamps bool
|
||||||
details bool
|
details bool
|
||||||
tail string
|
tail string
|
||||||
|
@ -38,6 +39,8 @@ func NewLogsCommand(dockerCli command.Cli) *cobra.Command {
|
||||||
flags := cmd.Flags()
|
flags := cmd.Flags()
|
||||||
flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output")
|
flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output")
|
||||||
flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)")
|
flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)")
|
||||||
|
flags.StringVar(&opts.until, "until", "", "Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)")
|
||||||
|
flags.SetAnnotation("until", "version", []string{"1.35"})
|
||||||
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps")
|
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps")
|
||||||
flags.BoolVar(&opts.details, "details", false, "Show extra details provided to logs")
|
flags.BoolVar(&opts.details, "details", false, "Show extra details provided to logs")
|
||||||
flags.StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs")
|
flags.StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs")
|
||||||
|
@ -51,6 +54,7 @@ func runLogs(dockerCli command.Cli, opts *logsOptions) error {
|
||||||
ShowStdout: true,
|
ShowStdout: true,
|
||||||
ShowStderr: true,
|
ShowStderr: true,
|
||||||
Since: opts.since,
|
Since: opts.since,
|
||||||
|
Until: opts.until,
|
||||||
Timestamps: opts.timestamps,
|
Timestamps: opts.timestamps,
|
||||||
Follow: opts.follow,
|
Follow: opts.follow,
|
||||||
Tail: opts.tail,
|
Tail: opts.tail,
|
||||||
|
|
Loading…
Reference in New Issue