diff options
Diffstat (limited to 'cmd/dgrep/main.go')
| -rw-r--r-- | cmd/dgrep/main.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/dgrep/main.go b/cmd/dgrep/main.go index 4da1bb3..4a6790b 100644 --- a/cmd/dgrep/main.go +++ b/cmd/dgrep/main.go @@ -36,12 +36,17 @@ func main() { flag.IntVar(&sshPort, "port", 2222, "SSH server port") flag.StringVar(&args.Discovery, "discovery", "", "Server discovery method") flag.StringVar(&args.PrivateKeyPathFile, "key", "", "Path to private key") - flag.StringVar(&args.RegexStr, "regex", ".", "Regular expression") flag.StringVar(&args.ServersStr, "servers", "", "Remote servers to connect") flag.StringVar(&args.UserName, "user", userName, "Your system user name") flag.StringVar(&args.What, "files", "", "File(s) to read") flag.StringVar(&cfgFile, "cfg", "", "Config file path") + + // Context awareness. + flag.StringVar(&args.LineContext.RegexStr, "regex", ".", "Regular expression") flag.StringVar(&grep, "grep", "", "Alias for -regex") + flag.IntVar(&args.LineContext.BeforeContext, "before", 0, "Print lines of leading context before matching lines") + flag.IntVar(&args.LineContext.AfterContext, "after", 0, "Print lines of trailing context after matching lines") + flag.IntVar(&args.LineContext.MaxCount, "max", 0, "Stop reading file after NUM matching lines") flag.Parse() |
