Skip to content

Commit

Permalink
flags: hidden not stable command flags (pingcap#133)
Browse files Browse the repository at this point in the history
* flags: hidden not stable command flags

* address comment
  • Loading branch information
3pointer authored and overvenus committed Jan 3, 2020
1 parent a9f72a1 commit 124d821
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func defineBackupFlags(flagSet *pflag.FlagSet) {
flagSet.BoolP(flagBackupChecksum, "", true,
"Run checksum after backup")
flagSet.Uint64P(flagLastBackupTS, "", 0, "the last time backup ts")
_ = flagSet.MarkHidden(flagLastBackupTS)
}

func runBackup(flagSet *pflag.FlagSet, cmdName, db, table string) error {
Expand Down
1 change: 1 addition & 0 deletions cmd/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func NewValidateCommand() *cobra.Command {
meta.AddCommand(newBackupMetaCommand())
meta.AddCommand(decodeBackupMetaCommand())
meta.AddCommand(encodeBackupMetaCommand())
meta.Hidden = true

return meta
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/storage/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ You can get one from
https://console.cloud.google.com/apis/credentials.`)

_ = flags.MarkHidden(gcsEndpointOption)
_ = flags.MarkHidden(gcsStorageClassOption)
_ = flags.MarkHidden(gcsPredefinedACL)
_ = flags.MarkHidden(gcsCredentialsFile)
}

func getBackendOptionsFromGCSFlags(flags *pflag.FlagSet) (options GCSBackendOptions, err error) {
Expand Down
7 changes: 7 additions & 0 deletions pkg/storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ func defineS3Flags(flags *pflag.FlagSet) {
flags.String(s3SSEOption, "", "Set the S3 server-side encryption algorithm, e.g. AES256")
flags.String(s3ACLOption, "", "Set the S3 canned ACLs, e.g. authenticated-read")
flags.String(s3ProviderOption, "", "Set the S3 provider, e.g. aws, alibaba, ceph")

_ = flags.MarkHidden(s3EndpointOption)
_ = flags.MarkHidden(s3RegionOption)
_ = flags.MarkHidden(s3StorageClassOption)
_ = flags.MarkHidden(s3SSEOption)
_ = flags.MarkHidden(s3ACLOption)
_ = flags.MarkHidden(s3ProviderOption)
}

func getBackendOptionsFromS3Flags(flags *pflag.FlagSet) (options S3BackendOptions, err error) {
Expand Down

0 comments on commit 124d821

Please sign in to comment.