mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-27 02:51:36 +00:00
32 lines
497 B
Go
32 lines
497 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/sagernet/sing-box/log"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var commandGeoipList = &cobra.Command{
|
|
Use: "list",
|
|
Short: "List geoip country codes",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
err := listGeoip()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
commandGeoip.AddCommand(commandGeoipList)
|
|
}
|
|
|
|
func listGeoip() error {
|
|
for _, code := range geoipReader.Metadata.Languages {
|
|
os.Stdout.WriteString(code + "\n")
|
|
}
|
|
return nil
|
|
}
|