fix #85: add --auto-headers and --custom-headers (#86)

This commit is contained in:
T.v.Dein
2025-10-10 13:08:16 +02:00
committed by GitHub
parent 4ce6c30f54
commit 8bdb3db105
7 changed files with 134 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ import (
)
const (
Version = "v1.5.9"
Version = "v1.5.10"
MAXPARTS = 2
)
@@ -93,6 +93,8 @@ type Config struct {
UseHighlight bool
Interactive bool
InputJSON bool
AutoHeaders bool
CustomHeaders []string
SortMode string
SortDescending bool
@@ -413,6 +415,12 @@ func (conf *Config) PreparePattern(patterns []*Pattern) error {
return nil
}
func (conf *Config) PrepareCustomHeaders(custom string) {
if len(custom) > 0 {
conf.CustomHeaders = strings.Split(custom, ",")
}
}
// Parse config file. Ignore if the file doesn't exist but return an
// error if it exists but fails to read or parse
func (conf *Config) ParseConfigfile() error {