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

@ -103,7 +103,7 @@ var containerCmd = &cobra.Command{
// bind exactly that cmd's flags to
// the viper before execution
commonflags.Bind(cmd)
bindAPIFlags(cmd)
commonflags.BindAPI(cmd)
},
}
@ -578,10 +578,7 @@ func init() {
initContainerSetEACLCmd()
for _, containerCommand := range containerChildCommand {
flags := containerCommand.Flags()
flags.StringSliceVarP(&xHeaders, xHeadersKey, xHeadersShorthand, xHeadersDefault, xHeadersUsage)
flags.Uint32P(ttl, ttlShorthand, ttlDefault, ttlUsage)
commonflags.InitAPI(containerCommand)
}
for _, cmd := range []*cobra.Command{