Skip to content

Commit b11eb5c

Browse files
authored
PLM-127: Add --include-namespaces and --exclude-namespaces flags (#113)
1 parent 9117fd8 commit b11eb5c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bin/plm start
7373
```sh
7474
curl -X POST http://localhost:2242/start -d '{
7575
"includeNamespaces": ["db1.collection1", "db2.collection2"],
76-
"excludeNamespaces": ["db3.collection3"]
76+
"excludeNamespaces": ["db3.collection3", "db4.*"]
7777
}'
7878
```
7979

main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,13 @@ var startCmd = &cobra.Command{
170170
}
171171

172172
pauseOnInitialSync, _ := cmd.Flags().GetBool("pause-on-initial-sync")
173+
includeNamespaces, _ := cmd.Flags().GetStringSlice("include-namespaces")
174+
excludeNamespaces, _ := cmd.Flags().GetStringSlice("exclude-namespaces")
173175

174176
startOptions := startRequest{
175177
PauseOnInitialSync: pauseOnInitialSync,
178+
IncludeNamespaces: includeNamespaces,
179+
ExcludeNamespaces: excludeNamespaces,
176180
}
177181

178182
return NewClient(port).Start(cmd.Context(), startOptions)
@@ -374,6 +378,10 @@ func main() {
374378
startCmd.Flags().Int("port", DefaultServerPort, "Port number")
375379
startCmd.Flags().Bool("pause-on-initial-sync", false, "Pause on Initial Sync")
376380
startCmd.Flags().MarkHidden("pause-on-initial-sync") //nolint:errcheck
381+
startCmd.Flags().StringSlice("include-namespaces", nil,
382+
"Namespaces to include in the replication (e.g. db1.collection1,db2.collection2)")
383+
startCmd.Flags().StringSlice("exclude-namespaces", nil,
384+
"Namespaces to exclude from the replication (e.g. db3.collection3,db4.*)")
377385

378386
pauseCmd.Flags().Int("port", DefaultServerPort, "Port number")
379387

0 commit comments

Comments
 (0)