CLI: Refactor "dry-run" and "yes" command flags to use helper functions

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-10-09 15:41:35 +02:00
parent f125bfd638
commit 9d968ab357
8 changed files with 124 additions and 36 deletions

View File

@@ -20,10 +20,7 @@ var CleanUpCommand = &cli.Command{
}
var cleanUpFlags = []cli.Flag{
&cli.BoolFlag{
Name: "dry",
Usage: "performs a dry run that doesn't actually remove anything",
},
DryRunFlag("performs a dry run that doesn't actually remove anything"),
}
// cleanUpAction removes orphaned index entries, sidecar and thumbnail files.
@@ -49,7 +46,7 @@ func cleanUpAction(ctx *cli.Context) error {
w := get.CleanUp()
opt := photoprism.CleanUpOptions{
Dry: ctx.Bool("dry"),
Dry: ctx.Bool("dry-run"),
}
// Start cleanup worker.