From 5beb1fc858445e7b25196594d74aaaee02b96adb Mon Sep 17 00:00:00 2001 From: Seednode Date: Mon, 8 May 2023 11:16:19 -0500 Subject: [PATCH] --debug now requires --cache, exits with error if not provided --- cmd/root.go | 5 +++++ cmd/version.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index d8f836a..6478541 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -27,6 +27,11 @@ var ( Use: "roulette [path]...", Short: "Serves random images from the specified directories.", Args: cobra.MinimumNArgs(1), + PreRun: func(cmd *cobra.Command, args []string) { + if debug { + cmd.MarkFlagRequired("cache") + } + }, RunE: func(cmd *cobra.Command, args []string) error { err := ServePage(args) if err != nil { diff --git a/cmd/version.go b/cmd/version.go index 60240f3..1b125bc 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -var Version = "0.43.0" +var Version = "0.43.1" func init() { rootCmd.AddCommand(versionCmd)