From 6f309316e28922c7671dcf5a490f0546f8e062be Mon Sep 17 00:00:00 2001 From: Jamie Hannaford Date: Wed, 10 May 2017 14:00:00 +0200 Subject: [PATCH] Add new CLI option for --until Signed-off-by: Jamie Hannaford --- cli/command/container/logs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/command/container/logs.go b/cli/command/container/logs.go index 6bf849f212..d8a7650074 100644 --- a/cli/command/container/logs.go +++ b/cli/command/container/logs.go @@ -14,6 +14,7 @@ import ( type logsOptions struct { follow bool since string + until string timestamps bool details bool tail string @@ -38,6 +39,8 @@ func NewLogsCommand(dockerCli command.Cli) *cobra.Command { flags := cmd.Flags() 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.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.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") @@ -51,6 +54,7 @@ func runLogs(dockerCli command.Cli, opts *logsOptions) error { ShowStdout: true, ShowStderr: true, Since: opts.since, + Until: opts.until, Timestamps: opts.timestamps, Follow: opts.follow, Tail: opts.tail,