forked from TrueCloudLab/frostfs-node
[#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:
parent
736e09a70d
commit
a2bcb3e0ce
6 changed files with 45 additions and 41 deletions
|
@ -28,7 +28,7 @@ var netmapCmd = &cobra.Command{
|
|||
// bind exactly that cmd's flags to
|
||||
// the viper before execution
|
||||
commonflags.Bind(cmd)
|
||||
bindAPIFlags(cmd)
|
||||
commonflags.BindAPI(cmd)
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -49,10 +49,7 @@ func init() {
|
|||
localNodeInfoCmd.Flags().BoolVar(&nodeInfoJSON, "json", false, "print node info in JSON format")
|
||||
|
||||
for _, netmapCommand := range netmapChildCommands {
|
||||
flags := netmapCommand.Flags()
|
||||
|
||||
flags.StringSliceVarP(&xHeaders, xHeadersKey, xHeadersShorthand, xHeadersDefault, xHeadersUsage)
|
||||
flags.Uint32P(ttl, ttlShorthand, ttlDefault, ttlUsage)
|
||||
commonflags.InitAPI(netmapCommand)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue