From 0ac3cc76b4b6c824c4b3f7a357d40b487984abfb Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 9 May 2024 22:33:42 +0200 Subject: Inject examples only with new --example flag The default use case should be to not inject example recipes. --- flags.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'flags.go') diff --git a/flags.go b/flags.go index 708e832..c7d3cff 100644 --- a/flags.go +++ b/flags.go @@ -8,13 +8,16 @@ import ( const help = `Ceres - Recipe server for local networks Usage: ceres [-h | --help] [-v | --version] [-c | --config] + [-e | --example] -h, --help show this help page and exit -v, --version print version information -c, --config file path to configuration file + -e, --examples inject example recipes on startup ` -var printVersion bool +var printVersion bool +var injectExamples bool func init() { flag.BoolVar(&printVersion, "version", false, "print version information") @@ -23,6 +26,9 @@ func init() { flag.StringVar(&config.Path, "config", "", "file path to configuration file") flag.StringVar(&config.Path, "c", "", "file path to configuration file") + flag.BoolVar(&injectExamples, "examples", false, "inject example recipes on startup") + flag.BoolVar(&injectExamples, "e", false, "inject example recipes on startup") + flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), help) } -- cgit v1.2.3-70-g09d2