[#1074] neofs-cli: Move common API flags to a separate package

TTL and XHeader flags are reused between multiple commands.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-05-30 16:04:40 +03:00 committed by fyrchik
parent 736e09a70d
commit a2bcb3e0ce
6 changed files with 45 additions and 41 deletions

View file

@ -28,7 +28,7 @@ var storagegroupCmd = &cobra.Command{
// bind exactly that cmd's flags to
// the viper before execution
commonflags.Bind(cmd)
bindAPIFlags(cmd)
commonflags.BindAPI(cmd)
},
}
@ -128,8 +128,7 @@ func init() {
flags := sgCommand.Flags()
flags.String(bearerTokenFlag, "", "File with signed JSON or binary encoded bearer token")
flags.StringSliceVarP(&xHeaders, xHeadersKey, xHeadersShorthand, xHeadersDefault, xHeadersUsage)
flags.Uint32P(ttl, ttlShorthand, ttlDefault, ttlUsage)
commonflags.InitAPI(sgCommand)
}
initSGPutCmd()