summaryrefslogtreecommitdiff
path: root/internal/clients/args.go
diff options
context:
space:
mode:
authorPaul Buetow <git@mx.buetow.org>2021-02-05 09:02:14 +0000
committerPaul Buetow <git@mx.buetow.org>2021-02-05 09:02:14 +0000
commit18a4de2bb288d44c4e5a7560fced7a15e9a6469d (patch)
treed7a570ae5e9209a175aecef527e56e69d6879bce /internal/clients/args.go
parenta40e3c5c01d0b33f23c53eba1276cf244e4d060b (diff)
add --max, --before, --after switches to dtail and dgrep commands
Diffstat (limited to 'internal/clients/args.go')
-rw-r--r--internal/clients/args.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/clients/args.go b/internal/clients/args.go
index 7f782f1..67d2044 100644
--- a/internal/clients/args.go
+++ b/internal/clients/args.go
@@ -6,14 +6,22 @@ import (
gossh "golang.org/x/crypto/ssh"
)
+// LineContext is here to help filtering out only specific lines.
+type LineContext struct {
+ RegexStr string
+ AfterContext int
+ BeforeContext int
+ MaxCount int
+}
+
// Args is a helper struct to summarize common client arguments.
type Args struct {
+ LineContext
Mode omode.Mode
ServersStr string
UserName string
What string
Arguments []string
- RegexStr string
RegexInvert bool
TrustAllHosts bool
Discovery string
@@ -22,5 +30,5 @@ type Args struct {
SSHAuthMethods []gossh.AuthMethod
SSHHostKeyCallback gossh.HostKeyCallback
PrivateKeyPathFile string
- Quiet bool
+ Quiet bool
}