summaryrefslogtreecommitdiff
path: root/cmd/dcat
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2021-09-18 13:16:36 +0300
committerPaul Buetow <paul@buetow.org>2021-10-02 12:26:29 +0300
commit7fbea88cf55af9b3354b4a1334e49c38d0d920fc (patch)
treea8451bef0a7b8860f1729b8919ca6e44b95e130b /cmd/dcat
parent5e717af91e8012c72ec7dc0204420dea46f187db (diff)
additional flags can be interpreted as file list
Diffstat (limited to 'cmd/dcat')
-rw-r--r--cmd/dcat/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/dcat/main.go b/cmd/dcat/main.go
index 1732c26..2ac773a 100644
--- a/cmd/dcat/main.go
+++ b/cmd/dcat/main.go
@@ -4,6 +4,7 @@ import (
"context"
"flag"
"os"
+ "strings"
"github.com/mimecast/dtail/internal/clients"
"github.com/mimecast/dtail/internal/config"
@@ -40,6 +41,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