From 642fed1cbf5160c89a93deab810bd44fb49d2a4a Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 12 May 2024 00:12:55 +0200 Subject: Move config path from config to flags struct This is metadata about the config and thus does not belong to the config itself. Moving it to the struct holding flag values is straight forward since it is defined by flags. --- flags.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'flags.go') diff --git a/flags.go b/flags.go index 1e802a1..a7a95e5 100644 --- a/flags.go +++ b/flags.go @@ -17,7 +17,8 @@ Usage: ceres [-h | --help] [-v | --version] [-c | --config] ` var flags struct { - version bool + version bool + config string examples bool } @@ -25,8 +26,8 @@ func init() { flag.BoolVar(&flags.version, "version", false, "print version information") flag.BoolVar(&flags.version, "v", false, "print version information") - flag.StringVar(&config.Path, "config", "", "file path to configuration file") - flag.StringVar(&config.Path, "c", "", "file path to configuration file") + flag.StringVar(&flags.config, "config", "", "file path to configuration file") + flag.StringVar(&flags.config, "c", "", "file path to configuration file") flag.BoolVar(&flags.examples, "examples", false, "inject example recipes on startup") flag.BoolVar(&flags.examples, "e", false, "inject example recipes on startup") -- cgit v1.2.3-70-g09d2