From 14bef6e82c02c837d57c8de4f732529c6a0ac1db Mon Sep 17 00:00:00 2001 From: Matthew Saxon Date: Mon, 17 Jun 2024 10:52:10 -0700 Subject: [PATCH 1/2] updating tail lines text --- internal/commands/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/commands/log.go b/internal/commands/log.go index fcced2f..a8a8da5 100644 --- a/internal/commands/log.go +++ b/internal/commands/log.go @@ -95,7 +95,7 @@ var ( cli.EnvVar(buildFlagEnvVar("TAIL_LINES")), altsrc.ConfigFile(configFlag.Name, "log.tail-lines"), ), - Usage: "`` of lines to return from the most recent log history", + Usage: "`` of lines to return from the most recent log history (1-5000)", Value: 100, Category: "Log:", Persistent: true, From b0411f80a808387217612bba8fec3e16af9fc1e7 Mon Sep 17 00:00:00 2001 From: Matthew Saxon Date: Mon, 17 Jun 2024 12:15:31 -0700 Subject: [PATCH 2/2] updating process ID to be required --- internal/commands/log.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/commands/log.go b/internal/commands/log.go index a8a8da5..14204ba 100644 --- a/internal/commands/log.go +++ b/internal/commands/log.go @@ -2,6 +2,7 @@ package commands import ( "context" + "errors" "fmt" "os" @@ -161,5 +162,12 @@ func ProcessLogConfigFrom(cmd *cli.Command) (*ProcessLogConfig, error) { } func (c *ProcessLogConfig) Validate() error { - return requireIntInRange(c.TailLines, minTailLines, maxTailLines, tailLinesFlag.Name) + var err error + err = errors.Join(err, requireIntInRange(c.TailLines, minTailLines, maxTailLines, tailLinesFlag.Name)) + + if c.ProcessID == "" { + err = errors.Join(err, missingRequiredFlag(processIDFlag.Name)) + } + + return err }