[#1402] cli: Add cid flag constant

Also, move common flag constants in `root` file of the `storagegroup`
package.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-06-20 19:33:34 +03:00 committed by fyrchik
parent 6f2363cf31
commit bc5882fc89
6 changed files with 16 additions and 17 deletions

View file

@ -15,11 +15,6 @@ import (
"github.com/spf13/cobra"
)
const (
sgIDFlag = "id"
sgRawFlag = "raw"
)
var sgID string
var sgGetCmd = &cobra.Command{
@ -34,8 +29,8 @@ func initSGGetCmd() {
flags := sgGetCmd.Flags()
flags.String("cid", "", "Container ID")
_ = sgGetCmd.MarkFlagRequired("cid")
flags.String(cidFlag, "", "Container ID")
_ = sgGetCmd.MarkFlagRequired(cidFlag)
flags.StringVarP(&sgID, sgIDFlag, "", "", "storage group identifier")
_ = sgGetCmd.MarkFlagRequired(sgIDFlag)