Skip to content

Commit

Permalink
Fix reading targets from file (#383)
Browse files Browse the repository at this point in the history
* Fix reading targets from file

* Fix test
  • Loading branch information
RamanaReddy0M authored Jun 26, 2024
1 parent 6348a88 commit c5f4dad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (options *Options) validateOptions() error {
return errors.New("verbose and silent can't be used together")
}

if options.Asn == nil && options.Ip == nil && options.Org == nil && options.Domain == nil && !fileutil.HasStdin() && cfgFile == "" {
if options.Asn == nil && options.Ip == nil && options.Org == nil && options.Domain == nil && !fileutil.HasStdin() && cfgFile == "" && options.FileInput == nil {
return errors.New("no input defined")
}

Expand Down Expand Up @@ -97,7 +97,7 @@ func ParseOptions() *Options {
flagSet.StringSliceVarP(&options.Ip, "ip", "i", nil, "target ip to lookup, example: -i 100.19.12.21, -i 2a10:ad40:: ", goflags.FileNormalizedStringSliceOptions),
flagSet.StringSliceVarP(&options.Domain, "domain", "d", nil, "target domain to lookup, example: -d google.com, -d facebook.com", goflags.FileNormalizedStringSliceOptions),
flagSet.StringSliceVar(&options.Org, "org", nil, "target organization to lookup, example: -org GOOGLE", goflags.StringSliceOptions),
flagSet.StringSliceVarP(&options.FileInput, "file", "f", nil, "targets to lookup from file", goflags.CommaSeparatedStringSliceOptions),
flagSet.StringSliceVarP(&options.FileInput, "file", "f", nil, "targets to lookup from file", goflags.FileCommaSeparatedStringSliceOptions),
)

// Configs
Expand Down
2 changes: 1 addition & 1 deletion runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestRunner(t *testing.T) {
expectedOutput: []*asnmap.Response{
{
FirstIp: "104.16.0.0",
LastIp: "104.21.127.255",
LastIp: "104.22.79.255",
Input: "104.16.99.52",
ASN: 13335,
Country: "US",
Expand Down

0 comments on commit c5f4dad

Please sign in to comment.