fix(search): read --force-rescan flag with its registered name

The `opencloud search index` command registers the flag as
`--force-rescan` (see pflag registration below) but reads it via
`GetBool("force-reindex")`, so the value is always false — passing
`--force-rescan` had no effect and no force rescan was ever triggered.

Read the flag under its registered name.
This commit is contained in:
Dominik Schmidt
2026-04-21 00:04:10 +02:00
committed by Ralf Haferkamp
parent 2fc33d6e60
commit e7806445dc

View File

@@ -29,7 +29,7 @@ func Index(cfg *config.Config) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
allSpacesFlag, _ := cmd.Flags().GetBool("all-spaces")
spaceFlag, _ := cmd.Flags().GetString("space")
forceReindexFlag, _ := cmd.Flags().GetBool("force-reindex")
forceReindexFlag, _ := cmd.Flags().GetBool("force-rescan")
if spaceFlag == "" && !allSpacesFlag {
return errors.New("either --space or --all-spaces is required")
}