diff --git a/cli/command/container/logs.go b/cli/command/container/logs.go index 6bf849f2..d8a76500 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,