From 911ae970ddac3dd5dd9e01d71e93780400535bc7 Mon Sep 17 00:00:00 2001 From: Haardik Dharma Date: Wed, 14 Sep 2022 14:32:51 +0530 Subject: [PATCH] Mark required args and flags --- cmd/objectstore/objectstore.go | 2 ++ cmd/objectstore/objectstore_credential_create.go | 1 + 2 files changed, 3 insertions(+) diff --git a/cmd/objectstore/objectstore.go b/cmd/objectstore/objectstore.go index 9154a526..7e4d5988 100644 --- a/cmd/objectstore/objectstore.go +++ b/cmd/objectstore/objectstore.go @@ -57,9 +57,11 @@ func init() { //Credential commands objectStoreCredentialCmd.AddCommand(objectStoreCredentialSecretCmd) objectStoreCredentialSecretCmd.Flags().StringVarP(&accessKey, "access-key", "a", "", "Access Key") + objectStoreCredentialSecretCmd.MarkFlagRequired("access-key") objectStoreCredentialCmd.AddCommand(objectStoreCredentialExportCmd) objectStoreCredentialExportCmd.Flags().StringVarP(&accessKey, "access-key", "a", "", "Access Key") objectStoreCredentialExportCmd.Flags().StringVarP(&format, "format", "", "env", "Format of the output (We support env and s3cfg formats.)") + objectStoreCredentialExportCmd.MarkFlagRequired("access-key") objectStoreCredentialCmd.AddCommand(objectStoreCredentialListCmd) objectStoreCredentialCmd.AddCommand(objectStoreCredentialCreateCmd) objectStoreCredentialCmd.AddCommand(objectStoreCredentialUpdateCmd) diff --git a/cmd/objectstore/objectstore_credential_create.go b/cmd/objectstore/objectstore_credential_create.go index ce47a348..d10b5b24 100644 --- a/cmd/objectstore/objectstore_credential_create.go +++ b/cmd/objectstore/objectstore_credential_create.go @@ -21,6 +21,7 @@ var objectStoreCredentialCreateCmd = &cobra.Command{ Long: `Create a new Object Store Credential with preexisting access key and secret key civo objectstore credential create CREDENTIAL_NAME --access-key ACCESS_KEY --secret-key SECRET_KEY `, + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { utility.EnsureCurrentRegion()