diff options
| author | Paul Buetow <git@mx.buetow.org> | 2021-02-05 09:02:14 +0000 |
|---|---|---|
| committer | Paul Buetow <git@mx.buetow.org> | 2021-02-05 09:02:14 +0000 |
| commit | 18a4de2bb288d44c4e5a7560fced7a15e9a6469d (patch) | |
| tree | d7a570ae5e9209a175aecef527e56e69d6879bce /internal/clients/maprclient.go | |
| parent | a40e3c5c01d0b33f23c53eba1276cf244e4d060b (diff) | |
add --max, --before, --after switches to dtail and dgrep commands
Diffstat (limited to 'internal/clients/maprclient.go')
| -rw-r--r-- | internal/clients/maprclient.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/clients/maprclient.go b/internal/clients/maprclient.go index 1c0c2cc..6a06aaf 100644 --- a/internal/clients/maprclient.go +++ b/internal/clients/maprclient.go @@ -110,21 +110,21 @@ func (c MaprClient) makeHandler(server string) handlers.Handler { return handlers.NewMaprHandler(server, c.query, c.globalGroup) } -func (c MaprClient) makeCommands() (commands []string) { +func (c MaprClient) makeCommands(options map[string]string) (commands []string) { commands = append(commands, fmt.Sprintf("map %s", c.query.RawQuery)) - options := fmt.Sprintf("quiet=%v", c.Args.Quiet) modeStr := "cat" if c.Mode == omode.TailClient { modeStr = "tail" } + optionsStr := c.commandOptionsToString(options) for _, file := range strings.Split(c.What, ",") { if c.Timeout > 0 { commands = append(commands, fmt.Sprintf("timeout %d %s %s %s", c.Timeout, modeStr, file, c.Regex.Serialize())) continue } - commands = append(commands, fmt.Sprintf("%s:%s %s %s", modeStr, options, file, c.Regex.Serialize())) + commands = append(commands, fmt.Sprintf("%s:%s %s %s", modeStr, optionsStr, file, c.Regex.Serialize())) } return |
