1717 ScanFrequencyHours = "{{SCAN_FREQUENCY_HOURS}}"
1818 SearchDirs []string
1919 EnableNPMScan * bool // nil=auto
20+ EnableBrewScan * bool // nil=auto
21+ EnablePythonScan * bool // nil=auto
2022 ColorMode string // "" means auto
2123 OutputFormat string // "" means default (pretty)
2224 HTMLOutputFile string // "" means not set
@@ -31,6 +33,8 @@ type ConfigFile struct {
3133 ScanFrequencyHours string `json:"scan_frequency_hours,omitempty"`
3234 SearchDirs []string `json:"search_dirs,omitempty"`
3335 EnableNPMScan * bool `json:"enable_npm_scan,omitempty"`
36+ EnableBrewScan * bool `json:"enable_brew_scan,omitempty"`
37+ EnablePythonScan * bool `json:"enable_python_scan,omitempty"`
3438 ColorMode string `json:"color_mode,omitempty"`
3539 OutputFormat string `json:"output_format,omitempty"`
3640 HTMLOutputFile string `json:"html_output_file,omitempty"`
@@ -79,6 +83,12 @@ func Load() {
7983 if cfg .EnableNPMScan != nil && EnableNPMScan == nil {
8084 EnableNPMScan = cfg .EnableNPMScan
8185 }
86+ if cfg .EnableBrewScan != nil && EnableBrewScan == nil {
87+ EnableBrewScan = cfg .EnableBrewScan
88+ }
89+ if cfg .EnablePythonScan != nil && EnablePythonScan == nil {
90+ EnablePythonScan = cfg .EnablePythonScan
91+ }
8292 if cfg .ColorMode != "" && ColorMode == "" {
8393 ColorMode = cfg .ColorMode
8494 }
@@ -156,6 +166,48 @@ func RunConfigure() error {
156166 existing .EnableNPMScan = nil // auto
157167 }
158168
169+ // Enable brew scan
170+ currentBrew := "auto"
171+ if existing .EnableBrewScan != nil {
172+ if * existing .EnableBrewScan {
173+ currentBrew = "true"
174+ } else {
175+ currentBrew = "false"
176+ }
177+ }
178+ brewInput := promptValue (reader , "Enable Homebrew Scan (auto/true/false)" , currentBrew )
179+ switch strings .ToLower (brewInput ) {
180+ case "true" :
181+ v := true
182+ existing .EnableBrewScan = & v
183+ case "false" :
184+ v := false
185+ existing .EnableBrewScan = & v
186+ default :
187+ existing .EnableBrewScan = nil
188+ }
189+
190+ // Enable python scan
191+ currentPython := "auto"
192+ if existing .EnablePythonScan != nil {
193+ if * existing .EnablePythonScan {
194+ currentPython = "true"
195+ } else {
196+ currentPython = "false"
197+ }
198+ }
199+ pythonInput := promptValue (reader , "Enable Python Scan (auto/true/false)" , currentPython )
200+ switch strings .ToLower (pythonInput ) {
201+ case "true" :
202+ v := true
203+ existing .EnablePythonScan = & v
204+ case "false" :
205+ v := false
206+ existing .EnablePythonScan = & v
207+ default :
208+ existing .EnablePythonScan = nil
209+ }
210+
159211 // Color mode
160212 currentColor := existing .ColorMode
161213 if currentColor == "" {
@@ -287,7 +339,9 @@ func ShowConfigure() {
287339 fmt .Printf (" %-24s %s\n " , "API Key:" , maskSecret (cfg .APIKey ))
288340 fmt .Printf (" %-24s %s\n " , "Scan Frequency:" , displayFrequency (cfg .ScanFrequencyHours ))
289341 fmt .Printf (" %-24s %s\n " , "Search Directories:" , displayDirs (cfg .SearchDirs ))
290- fmt .Printf (" %-24s %s\n " , "Enable NPM Scan:" , displayNPMScan (cfg .EnableNPMScan ))
342+ fmt .Printf (" %-24s %s\n " , "Enable NPM Scan:" , displayBoolScan (cfg .EnableNPMScan ))
343+ fmt .Printf (" %-24s %s\n " , "Enable Brew Scan:" , displayBoolScan (cfg .EnableBrewScan ))
344+ fmt .Printf (" %-24s %s\n " , "Enable Python Scan:" , displayBoolScan (cfg .EnablePythonScan ))
291345 fmt .Printf (" %-24s %s\n " , "Color Mode:" , displayColorMode (cfg .ColorMode ))
292346 fmt .Printf (" %-24s %s\n " , "Output Format:" , displayOutputFormat (cfg .OutputFormat ))
293347 if cfg .OutputFormat == "html" {
@@ -330,7 +384,7 @@ func displayDirs(dirs []string) string {
330384 return strings .Join (dirs , ", " )
331385}
332386
333- func displayNPMScan (v * bool ) string {
387+ func displayBoolScan (v * bool ) string {
334388 if v == nil {
335389 return "auto"
336390 }
0 commit comments