@@ -22,20 +22,23 @@ func (i *arrayFlags) Set(value string) error {
2222}
2323
2424var locations arrayFlags
25+ var excludeLocations arrayFlags
2526
2627func main () {
2728 token := flag .String ("token" , "" , "Github auth token" )
2829 amount := flag .Int ("amount" , 256 , "Amount of users to show" )
2930 considerNum := flag .Int ("consider" , 1000 , "Amount of users to consider" )
3031 outputOpt := flag .String ("output" , "plain" , "Output format: plain, csv" )
3132 fileName := flag .String ("file" , "" , "Output file (optional, defaults to stdout)" )
32- preset := flag .String ("preset" , "" , "Preset (optional)" )
33+ presetName := flag .String ("preset" , "" , "Preset (optional)" )
3334
3435 flag .Var (& locations , "location" , "Location to query" )
3536 flag .Parse ()
3637
37- if * preset != "" {
38- locations = Preset (* preset )
38+ if * presetName != "" {
39+ preset := Preset (* presetName )
40+ locations = preset .include
41+ excludeLocations = preset .exclude
3942 }
4043
4144 var format output.Format
@@ -50,7 +53,7 @@ func main() {
5053 log .Fatal ("Unrecognized output format: " , * outputOpt )
5154 }
5255
53- opts := top.Options {Token : * token , Locations : locations , Amount : * amount , ConsiderNum : * considerNum }
56+ opts := top.Options {Token : * token , Locations : locations , ExcludeLocations : excludeLocations , Amount : * amount , ConsiderNum : * considerNum }
5457 data , err := top .GithubTop (opts )
5558
5659 if err != nil {
0 commit comments