Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shijiesheng committed Sep 13, 2024
1 parent 3f80731 commit 9af55dd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
50 changes: 25 additions & 25 deletions tools/cassandra/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ func BuildCLIOptions() *cli.App {
EnvVars: []string{"CASSANDRA_PASSWORD"},
},
&cli.StringSliceFlag{
Name: schema.CLIFlagAllowedAuthenticators,
Name: schema.CLIFlagAllowedAuthenticators,
Aliases: []string{"aa"},
Value: cli.NewStringSlice(""),
Usage: "Set allowed authenticators for servers with custom authenticators",
Value: cli.NewStringSlice(""),
Usage: "Set allowed authenticators for servers with custom authenticators",
},
&cli.IntFlag{
Name: schema.CLIFlagTimeout,
Expand All @@ -122,9 +122,9 @@ func BuildCLIOptions() *cli.App {
EnvVars: []string{"CASSANDRA_KEYSPACE"},
},
&cli.BoolFlag{
Name: schema.CLIFlagQuiet,
Name: schema.CLIFlagQuiet,
Aliases: []string{"q"},
Usage: "Don't set exit status to 1 on error",
Usage: "Don't set exit status to 1 on error",
},
&cli.IntFlag{
Name: schema.CLIFlagProtoVersion,
Expand Down Expand Up @@ -172,24 +172,24 @@ func BuildCLIOptions() *cli.App {
Usage: "setup initial version of cassandra schema",
Flags: []cli.Flag{
&cli.StringFlag{
Name: schema.CLIFlagVersion,
Name: schema.CLIFlagVersion,
Aliases: []string{"v"},
Usage: "initial version of the schema, cannot be used with disable-versioning",
Usage: "initial version of the schema, cannot be used with disable-versioning",
},
&cli.StringFlag{
Name: schema.CLIFlagSchemaFile,
Name: schema.CLIFlagSchemaFile,
Aliases: []string{"f"},
Usage: "path to the .cql schema file; if un-specified, will just setup versioning tables",
Usage: "path to the .cql schema file; if un-specified, will just setup versioning tables",
},
&cli.BoolFlag{
Name: schema.CLIFlagDisableVersioning,
Name: schema.CLIFlagDisableVersioning,
Aliases: []string{"d"},
Usage: "disable setup of schema versioning",
Usage: "disable setup of schema versioning",
},
&cli.BoolFlag{
Name: schema.CLIFlagOverwrite,
Name: schema.CLIFlagOverwrite,
Aliases: []string{"o"},
Usage: "drop all existing tables before setting up new schema",
Usage: "drop all existing tables before setting up new schema",
},
},
Action: func(c *cli.Context) error {
Expand All @@ -202,14 +202,14 @@ func BuildCLIOptions() *cli.App {
Usage: "update cassandra schema to a specific version",
Flags: []cli.Flag{
&cli.StringFlag{
Name: schema.CLIFlagTargetVersion,
Name: schema.CLIFlagTargetVersion,
Aliases: []string{"v"},
Usage: "target version for the schema update, defaults to latest",
Usage: "target version for the schema update, defaults to latest",
},
&cli.StringFlag{
Name: schema.CLIFlagSchemaDir,
Name: schema.CLIFlagSchemaDir,
Aliases: []string{"d"},
Usage: "path to directory containing versioned schema",
Usage: "path to directory containing versioned schema",
},
&cli.BoolFlag{
Name: schema.CLIFlagDryrun,
Expand All @@ -226,21 +226,21 @@ func BuildCLIOptions() *cli.App {
Usage: "creates a Keyspace with simple strategy. If datacenter is provided, will use network topology strategy",
Flags: []cli.Flag{
&cli.StringFlag{
Name: schema.CLIFlagKeyspace,
Name: schema.CLIFlagKeyspace,
Aliases: []string{"k"},
Usage: "name of the Keyspace",
Usage: "name of the Keyspace",
},
&cli.StringFlag{
Name: schema.CLIFlagDatacenter,
Name: schema.CLIFlagDatacenter,
Aliases: []string{"dc"},
Value: "",
Usage: "name of the cassandra datacenter, used when creating the keyspace with network topology strategy",
Value: "",
Usage: "name of the cassandra datacenter, used when creating the keyspace with network topology strategy",
},
&cli.IntFlag{
Name: schema.CLIFlagReplicationFactor,
Name: schema.CLIFlagReplicationFactor,
Aliases: []string{"rf"},
Value: 1,
Usage: "replication factor for the Keyspace",
Value: 1,
Usage: "replication factor for the Keyspace",
},
},
Action: func(c *cli.Context) error {
Expand Down
32 changes: 16 additions & 16 deletions tools/sql/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ func BuildCLIOptions() *cli.App {
EnvVars: []string{"SQL_PLUGIN"},
},
&cli.BoolFlag{
Name: schema.CLIFlagQuiet,
Name: schema.CLIFlagQuiet,
Aliases: []string{"q"},
Usage: "Don't set exit status to 1 on error",
Usage: "Don't set exit status to 1 on error",
},
&cli.GenericFlag{
Name: schema.CLIFlagConnectAttributes,
Expand Down Expand Up @@ -146,24 +146,24 @@ func BuildCLIOptions() *cli.App {
Usage: "setup initial version of sql schema",
Flags: []cli.Flag{
&cli.StringFlag{
Name: schema.CLIFlagVersion,
Name: schema.CLIFlagVersion,
Aliases: []string{"v"},
Usage: "initial version of the schema, cannot be used with disable-versioning",
Usage: "initial version of the schema, cannot be used with disable-versioning",
},
&cli.StringFlag{
Name: schema.CLIFlagSchemaFile,
Name: schema.CLIFlagSchemaFile,
Aliases: []string{"f"},
Usage: "path to the .sql schema file; if un-specified, will just setup versioning tables",
Usage: "path to the .sql schema file; if un-specified, will just setup versioning tables",
},
&cli.BoolFlag{
Name: schema.CLIFlagDisableVersioning,
Name: schema.CLIFlagDisableVersioning,
Aliases: []string{"d"},
Usage: "disable setup of schema versioning",
Usage: "disable setup of schema versioning",
},
&cli.BoolFlag{
Name: schema.CLIFlagOverwrite,
Name: schema.CLIFlagOverwrite,
Aliases: []string{"o"},
Usage: "drop all existing tables before setting up new schema",
Usage: "drop all existing tables before setting up new schema",
},
},
Action: func(c *cli.Context) error {
Expand All @@ -176,14 +176,14 @@ func BuildCLIOptions() *cli.App {
Usage: "update sql schema to a specific version",
Flags: []cli.Flag{
&cli.StringFlag{
Name: schema.CLIFlagTargetVersion,
Name: schema.CLIFlagTargetVersion,
Aliases: []string{"v"},
Usage: "target version for the schema update, defaults to latest",
Usage: "target version for the schema update, defaults to latest",
},
&cli.StringFlag{
Name: schema.CLIFlagSchemaDir,
Name: schema.CLIFlagSchemaDir,
Aliases: []string{"d"},
Usage: "path to directory containing versioned schema",
Usage: "path to directory containing versioned schema",
},
&cli.BoolFlag{
Name: schema.CLIFlagDryrun,
Expand All @@ -200,9 +200,9 @@ func BuildCLIOptions() *cli.App {
Usage: "creates a database",
Flags: []cli.Flag{
&cli.StringFlag{
Name: schema.CLIFlagDatabase,
Name: schema.CLIFlagDatabase,
Aliases: []string{"db"},
Usage: "name of the database",
Usage: "name of the database",
},
},
Action: func(c *cli.Context) error {
Expand Down

0 comments on commit 9af55dd

Please sign in to comment.