From cb8a7858c4c3307bb88292f9bbd514d3741897c2 Mon Sep 17 00:00:00 2001 From: srinandan <13950006+srinandan@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:59:19 -0800 Subject: [PATCH] chore: harmonize flags across all commands --- cmd/apidocs/updatedocs.go | 2 +- cmd/apis/cloneapi.go | 4 ++-- cmd/apis/oascrtapis.go | 2 +- cmd/apps/listapp.go | 2 +- cmd/env/crttraceoverrides.go | 2 +- cmd/env/listsecact.go | 4 ++-- cmd/env/listsecin.go | 4 ++-- cmd/env/listsecreports.go | 4 ++-- cmd/env/setadmin.go | 2 +- cmd/env/setax.go | 4 ++-- cmd/env/setcustom.go | 2 +- cmd/env/setdeploy.go | 2 +- cmd/env/setsync.go | 2 +- cmd/env/updatetracecfg.go | 2 +- cmd/keyaliases/crtka.go | 8 ++++---- cmd/keyaliases/updateka.go | 2 +- cmd/ops/listops.go | 2 +- cmd/org/export.go | 4 ++-- cmd/org/import.go | 4 ++-- cmd/products/crtprod.go | 2 +- cmd/products/updprod.go | 2 +- cmd/targetservers/crtts.go | 10 +++++----- cmd/targetservers/updatets.go | 10 +++++----- 23 files changed, 41 insertions(+), 41 deletions(-) diff --git a/cmd/apidocs/updatedocs.go b/cmd/apidocs/updatedocs.go index d9e5d55b4..1fff9b167 100644 --- a/cmd/apidocs/updatedocs.go +++ b/cmd/apidocs/updatedocs.go @@ -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") diff --git a/cmd/apis/cloneapi.go b/cmd/apis/cloneapi.go index 7dddb4a4a..64977e666 100644 --- a/cmd/apis/cloneapi.go +++ b/cmd/apis/cloneapi.go @@ -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) { diff --git a/cmd/apis/oascrtapis.go b/cmd/apis/oascrtapis.go index 903d206b4..83ce2b320 100644 --- a/cmd/apis/oascrtapis.go +++ b/cmd/apis/oascrtapis.go @@ -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") diff --git a/cmd/apps/listapp.go b/cmd/apps/listapp.go index 106c34900..419a2e423 100644 --- a/cmd/apps/listapp.go +++ b/cmd/apps/listapp.go @@ -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") diff --git a/cmd/env/crttraceoverrides.go b/cmd/env/crttraceoverrides.go index f60362097..693c29fcf 100644 --- a/cmd/env/crttraceoverrides.go +++ b/cmd/env/crttraceoverrides.go @@ -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") diff --git a/cmd/env/listsecact.go b/cmd/env/listsecact.go index 83832aa67..b6f2fd07d 100644 --- a/cmd/env/listsecact.go +++ b/cmd/env/listsecact.go @@ -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") diff --git a/cmd/env/listsecin.go b/cmd/env/listsecin.go index 086aa7d4e..8cf270cbb 100644 --- a/cmd/env/listsecin.go +++ b/cmd/env/listsecin.go @@ -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") diff --git a/cmd/env/listsecreports.go b/cmd/env/listsecreports.go index ec42846f5..e2b315109 100644 --- a/cmd/env/listsecreports.go +++ b/cmd/env/listsecreports.go @@ -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") diff --git a/cmd/env/setadmin.go b/cmd/env/setadmin.go index 56141efce..c65fdd52a 100644 --- a/cmd/env/setadmin.go +++ b/cmd/env/setadmin.go @@ -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") diff --git a/cmd/env/setax.go b/cmd/env/setax.go index d54e99156..96838fb48 100644 --- a/cmd/env/setax.go +++ b/cmd/env/setax.go @@ -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") } diff --git a/cmd/env/setcustom.go b/cmd/env/setcustom.go index a293743ea..290b29194 100644 --- a/cmd/env/setcustom.go +++ b/cmd/env/setcustom.go @@ -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") diff --git a/cmd/env/setdeploy.go b/cmd/env/setdeploy.go index ab825ee77..b9fbecde0 100644 --- a/cmd/env/setdeploy.go +++ b/cmd/env/setdeploy.go @@ -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") diff --git a/cmd/env/setsync.go b/cmd/env/setsync.go index 8d9f5b1db..1c6d97bde 100644 --- a/cmd/env/setsync.go +++ b/cmd/env/setsync.go @@ -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") diff --git a/cmd/env/updatetracecfg.go b/cmd/env/updatetracecfg.go index 55a094cac..0ea2cfe6f 100644 --- a/cmd/env/updatetracecfg.go +++ b/cmd/env/updatetracecfg.go @@ -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") diff --git a/cmd/keyaliases/crtka.go b/cmd/keyaliases/crtka.go index ff7257291..c30ec7eaf 100644 --- a/cmd/keyaliases/crtka.go +++ b/cmd/keyaliases/crtka.go @@ -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") diff --git a/cmd/keyaliases/updateka.go b/cmd/keyaliases/updateka.go index 28d262097..df55666fe 100644 --- a/cmd/keyaliases/updateka.go +++ b/cmd/keyaliases/updateka.go @@ -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") diff --git a/cmd/ops/listops.go b/cmd/ops/listops.go index 48434555f..baff29293 100644 --- a/cmd/ops/listops.go +++ b/cmd/ops/listops.go @@ -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") } diff --git a/cmd/org/export.go b/cmd/org/export.go index 2aa5912dd..faf9c03ce 100644 --- a/cmd/org/export.go +++ b/cmd/org/export.go @@ -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") } diff --git a/cmd/org/import.go b/cmd/org/import.go index ea564a781..b9eb16f2a 100644 --- a/cmd/org/import.go +++ b/cmd/org/import.go @@ -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") diff --git a/cmd/products/crtprod.go b/cmd/products/crtprod.go index 3294aac9b..b55cf96f4 100644 --- a/cmd/products/crtprod.go +++ b/cmd/products/crtprod.go @@ -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") diff --git a/cmd/products/updprod.go b/cmd/products/updprod.go index ac92a42a3..10ef40885 100644 --- a/cmd/products/updprod.go +++ b/cmd/products/updprod.go @@ -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") diff --git a/cmd/targetservers/crtts.go b/cmd/targetservers/crtts.go index 995d9c924..99c75c7fd 100644 --- a/cmd/targetservers/crtts.go +++ b/cmd/targetservers/crtts.go @@ -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", diff --git a/cmd/targetservers/updatets.go b/cmd/targetservers/updatets.go index 85f9e3d8c..3d2aef9b2 100644 --- a/cmd/targetservers/updatets.go +++ b/cmd/targetservers/updatets.go @@ -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",