--debug now requires --cache, exits with error if not provided

This commit is contained in:
Seednode 2023-05-08 11:16:19 -05:00
parent 5fdfaee80d
commit 5beb1fc858
2 changed files with 6 additions and 1 deletions

View File

@ -27,6 +27,11 @@ var (
Use: "roulette <path> [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 {

View File

@ -10,7 +10,7 @@ import (
"github.com/spf13/cobra"
)
var Version = "0.43.0"
var Version = "0.43.1"
func init() {
rootCmd.AddCommand(versionCmd)