mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-01 12:43:08 -04:00
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:
committed by
Ralf Haferkamp
parent
2fc33d6e60
commit
e7806445dc
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user