diff options
| author | Loyalsoldier <[email protected]> | 2024-10-25 07:24:30 +0800 |
|---|---|---|
| committer | Loyalsoldier <[email protected]> | 2024-10-25 07:48:14 +0800 |
| commit | 38dfd08332dda5809191bc54ef06b781b1d81e44 (patch) | |
| tree | 7a673c45c0789fb626abbd556dac4f402057fa0b /plugin | |
| parent | 87404b7cbcdaa441ed812434852c8aef5c7a5405 (diff) | |
Refine: make lookup command more specific
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/special/lookup.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugin/special/lookup.go b/plugin/special/lookup.go index 34ba0207..6b9e6af0 100644 --- a/plugin/special/lookup.go +++ b/plugin/special/lookup.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "net/netip" + "slices" "strings" "github.com/Loyalsoldier/geoip/lib" @@ -85,7 +86,10 @@ func (l *lookup) Output(container lib.Container) error { lists, found, _ := container.Lookup(l.Search, l.SearchList...) if found { + slices.Sort(lists) fmt.Println(strings.ToLower(strings.Join(lists, ","))) + } else { + fmt.Println("false") } return nil |
