about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-05-17 12:25:49 +0200
committerAlan Pearce2024-05-17 12:25:49 +0200
commitd6e117bb9aeb2bae23dedd51b59b6e6f139e8a4f (patch)
tree9d44e191e4e84bc9ce28ac338ed48003cf0b909e
parentaf2068f882b390778023617e6c69c9274b346cde (diff)
downloadsearchix-d6e117bb9aeb2bae23dedd51b59b6e6f139e8a4f.tar.lz
searchix-d6e117bb9aeb2bae23dedd51b59b6e6f139e8a4f.tar.zst
searchix-d6e117bb9aeb2bae23dedd51b59b6e6f139e8a4f.zip
feat: exit after rebuilding index if `--replace` is specified
-rw-r--r--searchix.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/searchix.go b/searchix.go
index 59235cd..a369f73 100644
--- a/searchix.go
+++ b/searchix.go
@@ -87,6 +87,9 @@ func main() {
 		if err != nil {
 			log.Fatalf("Failed to build index: %v", err)
 		}
+		if *replace {
+			return
+		}
 	}
 
 	c := make(chan os.Signal, 2)