From 24c08519ec9a7eedd5ee58564a4acc02d1d2af29 Mon Sep 17 00:00:00 2001 From: srinandan Date: Sun, 19 Apr 2020 15:55:23 -0700 Subject: [PATCH] prod name is mandatory --- cmd/products/attributes.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/products/attributes.go b/cmd/products/attributes.go index 977e687c..a0f67540 100644 --- a/cmd/products/attributes.go +++ b/cmd/products/attributes.go @@ -29,6 +29,12 @@ var AttributesCmd = &cobra.Command{ var attrName string func init() { + + AttributesCmd.PersistentFlags().StringVarP(&name, "name", "n", + "", "API Product name") + + _ = AttributesCmd.MarkPersistentFlagRequired("name") + AttributesCmd.AddCommand(DelAttrCmd) AttributesCmd.AddCommand(ListAttrCmd) AttributesCmd.AddCommand(GetAttrCmd)