diff options
| author | sinner <[email protected]> | 2026-04-15 15:16:02 -0400 |
|---|---|---|
| committer | sinner <[email protected]> | 2026-04-15 15:16:02 -0400 |
| commit | a5f907854f29e1c267ad30d1dfe85c2c47f5ac48 (patch) | |
| tree | bc8685c3b22e6d5d47702ba0607c694f938ba7fd /cmd/breachforum.go | |
| parent | 8a1cf20dd5014ebe15ced77344902b79dcfa2e66 (diff) | |
| download | dborg-1.1.1.tar.gz dborg-1.1.1.zip | |
Diffstat (limited to 'cmd/breachforum.go')
| -rw-r--r-- | cmd/breachforum.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/cmd/breachforum.go b/cmd/breachforum.go index 63254c1..229292a 100644 --- a/cmd/breachforum.go +++ b/cmd/breachforum.go @@ -11,7 +11,7 @@ var breachforumCmd = &cobra.Command{ Aliases: []string{"brf"}, Short: "Search BreachForum data", Long: `Search breachdetect index for BreachForum messages and detections`, - Args: cobra.ExactArgs(1), + Args: argsOrStdin(1), RunE: runBreachForumSearch, } @@ -26,15 +26,17 @@ func runBreachForumSearch(cmd *cobra.Command, args []string) error { return err } - params := &models.BreachForumSearchParams{ - Search: args[0], - } - params.MaxHits, _ = cmd.Flags().GetInt("max_hits") - - response, err := c.SearchBreachForum(params) - if err != nil { - return err - } + maxHits, _ := cmd.Flags().GetInt("max_hits") - return formatter.FormatBreachForumResults(response, IsJSONOutput()) + return forEachQuery(args, func(query string) error { + params := &models.BreachForumSearchParams{ + Search: query, + MaxHits: maxHits, + } + response, err := c.SearchBreachForum(params) + if err != nil { + return err + } + return formatter.FormatBreachForumResults(response, IsJSONOutput()) + }) } |
