From 532a0818f72380ced8ca8b4e323c3f48aa8e9373 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 12 Jul 2024 15:12:05 +0100 Subject: [PATCH] fs: make sure we load the options defaults to start with --- fs/registry.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/registry.go b/fs/registry.go index d0799331f..ad9191d43 100644 --- a/fs/registry.go +++ b/fs/registry.go @@ -437,6 +437,17 @@ func RegisterGlobalOptions(oi OptionsInfo) { log.Fatalf("%v", err) } } + // Load the default values into the options. + // + // These will be from the ultimate defaults or environment + // variables. + // + // The flags haven't been processed yet so this will be run + // again when the flags are ready. + err := oi.load() + if err != nil { + log.Fatalf("Failed to load %q default values: %v", oi.Name, err) + } } var optionName = regexp.MustCompile(`^[a-z0-9_]+$`)