Skip to content

Commit

Permalink
chore: harmonize flags across all commands
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Jan 4, 2024
1 parent 117d273 commit cb8a785
Show file tree
Hide file tree
Showing 23 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion cmd/apidocs/updatedocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func init() {
"", "Path to a file containing OpenAPI Specification documentation")
UpdateDocCmd.Flags().StringVarP(&graphQLPath, "graphql", "q",
"", "Path to a file containing GraphQL documentation")
UpdateDocCmd.Flags().StringVarP(&endpointUri, "endpointUri", "e",
UpdateDocCmd.Flags().StringVarP(&endpointUri, "endpoint-uri", "e",
"", "URI for the GraphQL proxy")

_ = UpdateDocCmd.MarkFlagRequired("id")
Expand Down
4 changes: 2 additions & 2 deletions cmd/apis/cloneapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ func init() {

CloneCmd.Flags().StringVarP(&proxyZip, "proxy-zip", "p",
"", "Path to the Sharedflow bundle/zip file")
CloneCmd.Flags().StringVarP(&basePath, "base-path", "b",
CloneCmd.Flags().StringVarP(&basePath, "basepath", "b",
"", "A new basePath for the cloned proxy")
CloneCmd.Flags().StringVarP(&proxyFolder, "proxy-folder", "f",
"", "Path to the Sharedflow Bundle; ex: ./test/apiproxy")

_ = CloneCmd.MarkFlagRequired("name")
_ = CloneCmd.MarkFlagRequired("base-path")
_ = CloneCmd.MarkFlagRequired("basepath")
}

func copyDirectory() (tmpDir string, err error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/apis/oascrtapis.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func init() {
false, "Skip adding the OAS Validate policy")
OasCreateCmd.Flags().BoolVarP(&addCORS, "add-cors", "",
false, "Add a CORS policy")
OasCreateCmd.Flags().BoolVarP(&formatValidation, "formatValidation", "",
OasCreateCmd.Flags().BoolVarP(&formatValidation, "format-validation", "",
true, "disables validation of schema type formats")

_ = OasCreateCmd.MarkFlagRequired("name")
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/listapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func init() {
-1, "Number of apps; limit is 1000")
ListCmd.Flags().BoolVarP(&expand, "expand", "x",
false, "Expand Details")
ListCmd.Flags().BoolVarP(&includeCred, "inclCred", "i",
ListCmd.Flags().BoolVarP(&includeCred, "incl-cred", "i",
false, "Include Credentials")
ListCmd.Flags().StringVarP(&status, "status", "s",
"", "Filter by the status of the app. Valid values are approved or revoked")
Expand Down
2 changes: 1 addition & 1 deletion cmd/env/crttraceoverrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func init() {
"", "API Proxy name")
CrtTraceOverridesCmd.Flags().StringVarP(&exporter, "exporter", "x",
"", "Trace exporter can be JAEGER or CLOUD_TRACE")
CrtTraceOverridesCmd.Flags().StringVarP(&endpoint, "endpoint", "p",
CrtTraceOverridesCmd.Flags().StringVarP(&endpoint, "endpoint-uri", "p",
"", "Trace endpoint, used only with JAEGER")
CrtTraceOverridesCmd.Flags().StringVarP(&sampler, "sampler", "s",
"PROBABILITY", "Sampler can be set to PROBABILITY or OFF")
Expand Down
4 changes: 2 additions & 2 deletions cmd/env/listsecact.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ var ListSecActCmd = &cobra.Command{
}

func init() {
ListSecActCmd.Flags().IntVarP(&pageSize, "pageSize", "",
ListSecActCmd.Flags().IntVarP(&pageSize, "page-size", "",
-1, "The maximum number of versions to return")
ListSecActCmd.Flags().StringVarP(&pageToken, "pageToken", "",
ListSecActCmd.Flags().StringVarP(&pageToken, "page-token", "",
"", "A page token, received from a previous call")
ListSecActCmd.Flags().StringVarP(&filter, "filter", "",
"", "Filter results")
Expand Down
4 changes: 2 additions & 2 deletions cmd/env/listsecin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ var (
)

func init() {
ListSecInCmd.Flags().IntVarP(&pageSize, "pageSize", "",
ListSecInCmd.Flags().IntVarP(&pageSize, "page-size", "",
-1, "The maximum number of versions to return")
ListSecInCmd.Flags().StringVarP(&pageToken, "pageToken", "",
ListSecInCmd.Flags().StringVarP(&pageToken, "page-token", "",
"", "A page token, received from a previous call")
ListSecInCmd.Flags().StringVarP(&filter, "filter", "",
"", "Filter results")
Expand Down
4 changes: 2 additions & 2 deletions cmd/env/listsecreports.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ var ListSecReportCmd = &cobra.Command{
var from, to, dataset, status, submittedBy string

func init() {
ListSecReportCmd.Flags().IntVarP(&pageSize, "pageSize", "",
ListSecReportCmd.Flags().IntVarP(&pageSize, "page-size", "",
-1, "The maximum number of versions to return")
ListSecReportCmd.Flags().StringVarP(&pageToken, "pageToken", "",
ListSecReportCmd.Flags().StringVarP(&pageToken, "page-token", "",
"", "A page token, received from a previous call")
ListSecReportCmd.Flags().StringVarP(&from, "from", "f",
"", "Filter response list by returning security reports that created after this date time")
Expand Down
2 changes: 1 addition & 1 deletion cmd/env/setadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var SetAdminCmd = &cobra.Command{
func init() {
SetAdminCmd.Flags().StringVarP(&memberName, "name", "n",
"", "Member Name, example Service Account Name")
SetAdminCmd.Flags().StringVarP(&memberType, "memberType", "m",
SetAdminCmd.Flags().StringVarP(&memberType, "member-type", "m",
"serviceAccount", "memberType must be serviceAccount, user or group")

_ = SetAdminCmd.MarkFlagRequired("name")
Expand Down
4 changes: 2 additions & 2 deletions cmd/env/setax.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ var SetAxCmd = &cobra.Command{
func init() {
SetAxCmd.Flags().StringVarP(&memberName, "name", "n",
"", "Member Name, example Service Account Name")
SetAxCmd.Flags().StringVarP(&memberType, "memberType", "m",
SetAxCmd.Flags().StringVarP(&memberType, "member-type", "m",
"serviceAccount", "memberType must be serviceAccount, user or group")
SetAxCmd.Flags().StringVarP(&role, "memberRole", "",
SetAxCmd.Flags().StringVarP(&role, "member-role", "",
"analyticsAgent", "memberRole must be analyticsViewer or analyticsAgent")
_ = SetAxCmd.MarkFlagRequired("name")
}
2 changes: 1 addition & 1 deletion cmd/env/setcustom.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func init() {
"", "Member Name, example Service Account Name")
SetCustCmd.Flags().StringVarP(&role, "role", "",
"", "Custom IAM role in the format projects/{project-id}/roles/{role}")
SetCustCmd.Flags().StringVarP(&memberType, "memberType", "m",
SetCustCmd.Flags().StringVarP(&memberType, "member-type", "m",
"serviceAccount", "memberType must be serviceAccount, user or group")

_ = SetCustCmd.MarkFlagRequired("name")
Expand Down
2 changes: 1 addition & 1 deletion cmd/env/setdeploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var SetDepCmd = &cobra.Command{
func init() {
SetDepCmd.Flags().StringVarP(&memberName, "name", "n",
"", "Member Name, example Service Account Name")
SetDepCmd.Flags().StringVarP(&memberType, "memberType", "m",
SetDepCmd.Flags().StringVarP(&memberType, "member-type", "m",
"serviceAccount", "memberType must be serviceAccount, user or group")

_ = SetDepCmd.MarkFlagRequired("name")
Expand Down
2 changes: 1 addition & 1 deletion cmd/env/setsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var SetSyncCmd = &cobra.Command{
func init() {
SetSyncCmd.Flags().StringVarP(&memberName, "name", "n",
"", "Member Name, example Service Account Name")
SetSyncCmd.Flags().StringVarP(&memberType, "memberType", "m",
SetSyncCmd.Flags().StringVarP(&memberType, "member-type", "m",
"serviceAccount", "memberType must be serviceAccount, user or group")

_ = SetSyncCmd.MarkFlagRequired("name")
Expand Down
2 changes: 1 addition & 1 deletion cmd/env/updatetracecfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var exporter, endpoint, sampler, sampleRate string
func init() {
UpdateTraceConfigCmd.Flags().StringVarP(&exporter, "exporter", "x",
"", "Trace exporter can be JAEGER or CLOUD_TRACE")
UpdateTraceConfigCmd.Flags().StringVarP(&endpoint, "endpoint", "p",
UpdateTraceConfigCmd.Flags().StringVarP(&endpoint, "endpoint-uri", "p",
"", "Trace endpoint, used only with JAEGER")
UpdateTraceConfigCmd.Flags().StringVarP(&sampler, "sampler", "s",
"PROBABILITY", "Sampler can be set to PROBABILITY or OFF")
Expand Down
8 changes: 4 additions & 4 deletions cmd/keyaliases/crtka.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ func init() {
false, "Ignore expiry validation")
CreateCmd.Flags().BoolVarP(&ignoreNewLine, "nl", "w",
false, "Ignore new line in cert chain")
CreateCmd.Flags().StringVarP(&certFile, "certFilePath", "",
CreateCmd.Flags().StringVarP(&certFile, "cert-filepath", "",
"", "Path to the X509 certificate in PEM format")
CreateCmd.Flags().StringVarP(&keyFile, "keyFilePath", "",
CreateCmd.Flags().StringVarP(&keyFile, "key-filepath", "",
"", "Path to the X509 key in PEM format")
CreateCmd.Flags().StringVarP(&pfxFile, "pfxFilePath", "",
CreateCmd.Flags().StringVarP(&pfxFile, "pfx-filepath", "",
"", "Path to the PFX file")
CreateCmd.Flags().StringVarP(&selfFile, "selfsignedFilePath", "",
CreateCmd.Flags().StringVarP(&selfFile, "selfsigned-filepath", "",
"", "Path to a JSON file containing details for a self signed certificate")

_ = CreateCmd.MarkFlagRequired("alias")
Expand Down
2 changes: 1 addition & 1 deletion cmd/keyaliases/updateka.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func init() {
false, "Ignore expiry validation")
UpdateCmd.Flags().BoolVarP(&ignoreNewLine, "nl", "w",
false, "Ignore new line in cert chain")
UpdateCmd.Flags().StringVarP(&certFile, "certFilePath", "",
UpdateCmd.Flags().StringVarP(&certFile, "cert-filepath", "",
"", "Path to the X509 certificate in PEM format")

_ = UpdateCmd.MarkFlagRequired("alias")
Expand Down
2 changes: 1 addition & 1 deletion cmd/ops/listops.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ var (
func init() {
ListCmd.Flags().StringVarP(&state, "state", "s",
"", "filter by operation state: FINISHED, ERROR, IN_PROGRESS")
ListCmd.Flags().StringVarP(&completeState, "completeState", "c",
ListCmd.Flags().StringVarP(&completeState, "complete-state", "c",
"", "filter by operation compeleted state: Success, Failed or Both")
}
4 changes: 2 additions & 2 deletions cmd/org/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@ func init() {
4, "Number of connections")
/*ExportCmd.Flags().StringVarP(&folder, "folder", "f",
"", "Folder to export org data")*/
ExportCmd.Flags().BoolVarP(&exportEntries, "exportEntries", "",
ExportCmd.Flags().BoolVarP(&exportEntries, "export-entries", "",
true, "Export all KVM entries")
ExportCmd.Flags().BoolVarP(&cleanPath, "clean", "",
false, "clean folder or files and directories before export")
ExportCmd.Flags().BoolVarP(&allRevisions, "all", "",
false, "Export all revisions, default=false. Exports the latest revision."+
"Applies to proxies, sf and sec profiles")
ExportCmd.Flags().BoolVarP(&continueOnErr, "continueOnError", "",
ExportCmd.Flags().BoolVarP(&continueOnErr, "continue-on-error", "",
false, "Ignore errors and continue exporting data")
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/org/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ func init() {
4, "Number of connections")
ImportCmd.Flags().StringVarP(&folder, "folder", "f",
"", "folder containing API proxy bundles")
ImportCmd.Flags().BoolVarP(&importTrace, "importTrace", "",
ImportCmd.Flags().BoolVarP(&importTrace, "import-trace", "",
false, "Import distributed trace configuration; default false")
ImportCmd.Flags().BoolVarP(&importDebugmask, "importDebugmask", "",
ImportCmd.Flags().BoolVarP(&importDebugmask, "import-debugmask", "",
false, "Import debugmask configuration; default false")

_ = ImportCmd.MarkFlagRequired("folder")
Expand Down
2 changes: 1 addition & 1 deletion cmd/products/crtprod.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var operationGroupFile, gqlOperationGroupFile, grpcOperationGroupFile string
func init() {
CreateCmd.Flags().StringVarP(&name, "name", "n",
"", "Name of the API Product")
CreateCmd.Flags().StringVarP(&displayName, "displayname", "m",
CreateCmd.Flags().StringVarP(&displayName, "display-name", "m",
"", "Display Name of the API Product")
CreateCmd.Flags().StringVarP(&description, "desc", "d",
"", "Description for the API Product")
Expand Down
2 changes: 1 addition & 1 deletion cmd/products/updprod.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var UpdateCmd = &cobra.Command{
func init() {
UpdateCmd.Flags().StringVarP(&name, "name", "n",
"", "Name of the API Product")
UpdateCmd.Flags().StringVarP(&displayName, "displayname", "m",
UpdateCmd.Flags().StringVarP(&displayName, "display-name", "m",
"", "Display Name of the API Product")
UpdateCmd.Flags().StringVarP(&description, "desc", "d",
"", "Description for the API Product")
Expand Down
10 changes: 5 additions & 5 deletions cmd/targetservers/crtts.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ func init() {
CreateCmd.Flags().BoolVarP(&enable, "enable", "b",
true, "Enabling/disabling a TargetServer")

CreateCmd.Flags().StringVarP(&keyStore, "keyStore", "",
CreateCmd.Flags().StringVarP(&keyStore, "keystore", "",
"", "Key store for the target server")
CreateCmd.Flags().StringVarP(&keyAlias, "keyAlias", "",
CreateCmd.Flags().StringVarP(&keyAlias, "keyalias", "",
"", "Key alias for the target server")
CreateCmd.Flags().StringVarP(&trustStore, "trustStore", "",
CreateCmd.Flags().StringVarP(&trustStore, "truststore", "",
"", "Trust store for the target server")

CreateCmd.Flags().StringVarP(&tlsenabled, "tls", "",
"", "Enable TLS for the target server")
CreateCmd.Flags().StringVarP(&clientAuthEnabled, "clientAuth", "c",
CreateCmd.Flags().StringVarP(&clientAuthEnabled, "client-auth", "c",
"", "Enable mTLS for the target server")
CreateCmd.Flags().StringVarP(&ignoreValidationErrors, "ignoreErr", "i",
CreateCmd.Flags().StringVarP(&ignoreValidationErrors, "ignore-err", "i",
"", "Ignore TLS validation errors for the target server")

CreateCmd.Flags().IntVarP(&port, "port", "p",
Expand Down
10 changes: 5 additions & 5 deletions cmd/targetservers/updatets.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ func init() {
UpdateCmd.Flags().BoolVarP(&enable, "enable", "b",
true, "Enabling/disabling a TargetServer")

UpdateCmd.Flags().StringVarP(&keyStore, "keyStore", "",
UpdateCmd.Flags().StringVarP(&keyStore, "keystore", "",
"", "Key store for the target server")
UpdateCmd.Flags().StringVarP(&keyAlias, "keyAlias", "",
UpdateCmd.Flags().StringVarP(&keyAlias, "keyalias", "",
"", "Key alias for the target server")
UpdateCmd.Flags().StringVarP(&trustStore, "trustStore", "",
UpdateCmd.Flags().StringVarP(&trustStore, "truststore", "",
"", "Trust store for the target server")

UpdateCmd.Flags().StringVarP(&tlsenabled, "tls", "",
"", "Enable TLS for the target server")
UpdateCmd.Flags().StringVarP(&clientAuthEnabled, "clientAuth", "c",
UpdateCmd.Flags().StringVarP(&clientAuthEnabled, "client-auth", "c",
"", "Enable mTLS for the target server")
UpdateCmd.Flags().StringVarP(&ignoreValidationErrors, "ignoreErr", "i",
UpdateCmd.Flags().StringVarP(&ignoreValidationErrors, "ignore-err", "i",
"", "Ignore TLS validation errors for the target server")

UpdateCmd.Flags().IntVarP(&port, "port", "p",
Expand Down

0 comments on commit cb8a785

Please sign in to comment.