all: reword comments to state behavior directly

Comments (and one test comment) now describe the rules on their own terms
instead of by comparison to another downloader. No behavior change.
This commit is contained in:
2026-06-21 16:10:13 +09:00
parent 6c045999f2
commit 6e77cde4cc
5 changed files with 12 additions and 14 deletions

View File

@@ -27,9 +27,8 @@ func (o *Options) IsSet(name string) bool { return o.set[name] }
// Str returns the raw string value (empty if unset and no default).
func (o *Options) Str(name string) string { return o.vals[name] }
// boolWords is the accepted vocabulary for boolean options. aria2 takes only
// true/false (and rejects everything else), so we match it rather than inventing
// extra spellings. boolWord is the single consult point — the Bool reader,
// boolWords is the accepted vocabulary for boolean options: exactly true and
// false, nothing else. boolWord is the single consult point — the Bool reader,
// validate(), and the no-conf bootstrap all go through it — so exactly the words
// that validate are honoured.
var boolWords = map[string]bool{
@@ -38,9 +37,8 @@ var boolWords = map[string]bool{
}
// boolWord reports a value's truth and whether it is a recognised boolean word.
// Whitespace is trimmed (aria2 strips config values too), but case is
// significant: aria2 rejects "True"/"TRUE", so the match is against exactly
// "true"/"false".
// Whitespace is trimmed, but case is significant: "True"/"TRUE" are rejected, so
// the match is against exactly "true"/"false".
func boolWord(s string) (val, ok bool) {
val, ok = boolWords[strings.TrimSpace(s)]
return val, ok