diff --git a/findURL.go b/findURL.go index fbbaf60..687d0c2 100644 --- a/findURL.go +++ b/findURL.go @@ -16,12 +16,12 @@ func findURL(config *Config, binaryNames []string, verbosityLevel Verbosity, met // Check if binaryName is a valid URL parsedURL, err := url.ParseRequestURI(binaryName) if err == nil && parsedURL.Scheme != "" && parsedURL.Host != "" { - // If it's a valid URL, return it with the checksum set to "!no_warn" + // If it's a valid URL, return it with the checksum set to "null" if verbosityLevel >= extraVerbose { fmt.Printf("\033[2K\rFound \"%s\" is already a valid URL", binaryName) } foundURLs = append(foundURLs, binaryName) - foundB3sum = append(foundB3sum, "!no_warn") + foundB3sum = append(foundB3sum, "null") continue } diff --git a/fsearch.go b/fsearch.go index 9b99a3d..06ceca0 100644 --- a/fsearch.go +++ b/fsearch.go @@ -39,9 +39,22 @@ func fSearch(config *Config, searchTerm string, metadata map[string]interface{}) } } + // Extract real names for filtering + allBinaryNames := make([]string, len(binaries)) + for i, binary := range binaries { + allBinaryNames[i] = binary.RealName + } + + // Filter binaries using the filterBinaries function from list.go + filteredBinaryNames := filterBinaries(allBinaryNames) + // Filter binaries based on the search term and architecture searchResults := make([]string, 0) for _, binary := range binaries { + if !contains(filteredBinaryNames, binary.RealName) || binary.Description == "" { + continue + } + if strings.Contains(strings.ToLower(binary.RealName), strings.ToLower(searchTerm)) || strings.Contains(strings.ToLower(binary.Description), strings.ToLower(searchTerm)) { entry := fmt.Sprintf("%s - %s", binary.RealName, binary.Description)