[#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

@ -20,11 +20,9 @@ func readObjectAddress(cmd *cobra.Command, cnr *cid.ID, obj *oid.ID) oid.Address
}
func readCID(cmd *cobra.Command, id *cid.ID) {
const flag = "cid"
f := cmd.Flag(flag)
f := cmd.Flag(cidFlag)
if f == nil {
common.ExitOnErr(cmd, "", fmt.Errorf("missing container flag (%s)", flag))
common.ExitOnErr(cmd, "", fmt.Errorf("missing container flag (%s)", cidFlag))
return
}