[#1323] neofs-cli: Reuse JSON flag for multiple commands
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
e812d78672
commit
9816d59ec0
12 changed files with 17 additions and 13 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"os"
|
||||
|
||||
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/common"
|
||||
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
@ -23,13 +24,13 @@ func initConvertEACLCmd() {
|
|||
_ = convertEACLCmd.MarkFlagRequired("from")
|
||||
|
||||
flags.String("to", "", "File to dump extended ACL table (default: binary encoded)")
|
||||
flags.Bool("json", false, "Dump extended ACL table in JSON encoding")
|
||||
flags.Bool(commonflags.JSON, false, "Dump extended ACL table in JSON encoding")
|
||||
}
|
||||
|
||||
func convertEACLTable(cmd *cobra.Command, _ []string) {
|
||||
pathFrom := cmd.Flag("from").Value.String()
|
||||
to := cmd.Flag("to").Value.String()
|
||||
jsonFlag, _ := cmd.Flags().GetBool("json")
|
||||
jsonFlag, _ := cmd.Flags().GetBool(commonflags.JSON)
|
||||
|
||||
table := common.ReadEACL(cmd, pathFrom)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue