@@ -51,13 +51,28 @@ to quickly create a Cobra application.`,
51
51
return
52
52
}
53
53
outputInJSON , _ := cmd .Flags ().GetBool ("json" )
54
- mada .Search (args [0 ], outputInJSON )
54
+ searchForFokontany , _ := cmd .Flags ().GetBool ("fokontany" )
55
+ searchForCommune , _ := cmd .Flags ().GetBool ("commune" )
56
+ searchForDistrict , _ := cmd .Flags ().GetBool ("district" )
57
+ searchForRegion , _ := cmd .Flags ().GetBool ("region" )
58
+ options := mada.SearchOptions {
59
+ OutputInJSON : outputInJSON ,
60
+ SearchForFokontany : searchForFokontany ,
61
+ SearchForCommune : searchForCommune ,
62
+ SearchForDistrict : searchForDistrict ,
63
+ SearchForRegion : searchForRegion ,
64
+ }
65
+ mada .Search (args [0 ], options )
55
66
},
56
67
}
57
68
58
69
func init () {
59
70
rootCmd .AddCommand (searchCmd )
60
71
searchCmd .Flags ().BoolP ("json" , "j" , false , "Output in JSON format" )
72
+ searchCmd .Flags ().BoolP ("fokontany" , "f" , false , "Search for a fokontany" )
73
+ searchCmd .Flags ().BoolP ("commune" , "c" , false , "Search for a commune" )
74
+ searchCmd .Flags ().BoolP ("district" , "d" , false , "Search for a district" )
75
+ searchCmd .Flags ().BoolP ("region" , "r" , false , "Search for a region" )
61
76
62
77
// Here you will define your flags and configuration settings.
63
78
0 commit comments