diff options
| author | Felix Hanley <felix@userspace.com.au> | 2017-06-18 06:31:48 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2017-06-18 06:31:48 +0000 |
| commit | de6c420e7706c5705b3b48e545c9c5fd81ab851c (patch) | |
| tree | 02f1e2f41ce25acb0bd3e4f5a906a997ca3545d9 | |
| parent | ec94ce62fc7b453d6fc0bf0a3d5eae92776096f7 (diff) | |
| download | dhtsearch-de6c420e7706c5705b3b48e545c9c5fd81ab851c.tar.gz dhtsearch-de6c420e7706c5705b3b48e545c9c5fd81ab851c.tar.bz2 | |
Ensure the default set of tags are skipped
| -rw-r--r-- | config.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -32,15 +32,16 @@ type advancedConfig struct { func loadConfig() { if _, err := os.Stat("config.toml"); !os.IsNotExist(err) { - md, err := toml.DecodeFile("config.toml", &Config) + _, err := toml.DecodeFile("config.toml", &Config) if err != nil { fmt.Printf("Failed to read configuration: %q\n", err) os.Exit(1) } + } - if !md.IsDefined("SkipTags") { - Config.SkipTags = []string{"adult"} - } + // Leave it to the user to get around this + if len(Config.SkipTags) == 0 { + Config.SkipTags = []string{"adult"} } flag.IntVar(&Config.BasePort, "base-port", 6881, "listen port (and first of multiple ports)") |
