Skip to content

Commit 0564baa

Browse files
More topo flags
Signed-off-by: Rohit Nayak <[email protected]>
1 parent a99c141 commit 0564baa

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

go/cmd/topo2topo/cli/topo2topo.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"vitess.io/vitess/go/vt/sqlparser"
3030
"vitess.io/vitess/go/vt/topo"
3131
"vitess.io/vitess/go/vt/topo/helpers"
32+
"vitess.io/vitess/go/vt/utils"
3233
)
3334

3435
var (
@@ -60,12 +61,12 @@ It can also be used to compare data between two topologies.`,
6061
func init() {
6162
servenv.MoveFlagsToCobraCommand(Main)
6263

63-
Main.Flags().StringVar(&fromImplementation, "from_implementation", fromImplementation, "topology implementation to copy data from")
64-
Main.Flags().StringVar(&fromServerAddress, "from_server", fromServerAddress, "topology server address to copy data from")
65-
Main.Flags().StringVar(&fromRoot, "from_root", fromRoot, "topology server root to copy data from")
66-
Main.Flags().StringVar(&toImplementation, "to_implementation", toImplementation, "topology implementation to copy data to")
67-
Main.Flags().StringVar(&toServerAddress, "to_server", toServerAddress, "topology server address to copy data to")
68-
Main.Flags().StringVar(&toRoot, "to_root", toRoot, "topology server root to copy data to")
64+
utils.SetFlagStringVar(Main.Flags(), &fromImplementation, "from-implementation", fromImplementation, "topology implementation to copy data from")
65+
utils.SetFlagStringVar(Main.Flags(), &fromServerAddress, "from-server", fromServerAddress, "topology server address to copy data from")
66+
utils.SetFlagStringVar(Main.Flags(), &fromRoot, "from-root", fromRoot, "topology server root to copy data from")
67+
utils.SetFlagStringVar(Main.Flags(), &toImplementation, "to-implementation", toImplementation, "topology implementation to copy data to")
68+
utils.SetFlagStringVar(Main.Flags(), &toServerAddress, "to-server", toServerAddress, "topology server address to copy data to")
69+
utils.SetFlagStringVar(Main.Flags(), &toRoot, "to-root", toRoot, "topology server root to copy data to")
6970
Main.Flags().BoolVar(&compare, "compare", compare, "compares data between topologies")
7071
Main.Flags().BoolVar(&doKeyspaces, "do-keyspaces", doKeyspaces, "copies the keyspace information")
7172
Main.Flags().BoolVar(&doShards, "do-shards", doShards, "copies the shard information")

0 commit comments

Comments
 (0)