From 7fbea88cf55af9b3354b4a1334e49c38d0d920fc Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 18 Sep 2021 13:16:36 +0300 Subject: additional flags can be interpreted as file list --- cmd/dgrep/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmd/dgrep') diff --git a/cmd/dgrep/main.go b/cmd/dgrep/main.go index f32be34..35b2236 100644 --- a/cmd/dgrep/main.go +++ b/cmd/dgrep/main.go @@ -4,6 +4,7 @@ import ( "context" "flag" "os" + "strings" "github.com/mimecast/dtail/internal/clients" "github.com/mimecast/dtail/internal/config" @@ -44,6 +45,15 @@ func main() { flag.Parse() + if args.What == "" { + // Interpret additional args as file list. + var files []string + for _, file := range flag.Args() { + files = append(files, file) + } + args.What = strings.Join(files, ",") + } + config.Read(cfgFile, sshPort) if noColor { config.Client.TermColorsEnable = false -- cgit v1.2.3