From 04ac22d244541cbb9a2629f464526a08de17b48a Mon Sep 17 00:00:00 2001 From: flywukong <2229306838@qq.com> Date: Wed, 22 Nov 2023 19:08:16 +0800 Subject: [PATCH] fix: fix the position of the format flag --- cmd/cmd_head.go | 22 ++++++++++++++++++++++ cmd/main.go | 6 ------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/cmd/cmd_head.go b/cmd/cmd_head.go index 6cf42f2..04683f6 100644 --- a/cmd/cmd_head.go +++ b/cmd/cmd_head.go @@ -19,6 +19,14 @@ func cmdHeadObj() *cli.Command { send headObject txn to chain and fetch object info on greenfield chain Examples: $ gnfd-cmd object head gnfd://bucket-name/object-name`, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: formatFlag, + Aliases: []string{"f"}, + Value: defaultFormat, + Usage: "return the meta with the format of plaintxt or json", + }, + }, } } @@ -33,6 +41,14 @@ func cmdHeadBucket() *cli.Command { send headBucket txn to chain and fetch bucket info on greenfield chain Examples: $ gnfd-cmd bucket head gnfd://bucket-name`, + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: formatFlag, + Aliases: []string{"f"}, + Value: defaultFormat, + Usage: "return the meta with the format of plaintxt or json", + }, + }, } } @@ -53,6 +69,12 @@ $ gnfd-cmd group head --groupOwner group-name`, Value: "", Usage: "need set the owner address if you are not the owner of the group", }, + &cli.StringFlag{ + Name: formatFlag, + Aliases: []string{"f"}, + Value: defaultFormat, + Usage: "return the meta with the format of plaintxt or json", + }, }, } } diff --git a/cmd/main.go b/cmd/main.go index d9b0e9e..8dfa3dd 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -52,12 +52,6 @@ func main() { Aliases: []string{"p"}, Usage: "password file for encrypting and decoding the private key", }, - &cli.StringFlag{ - Name: formatFlag, - Aliases: []string{"f"}, - Value: defaultFormat, - Usage: "return format of plaintxt or json", - }, &cli.StringFlag{ Name: configFlag, Aliases: []string{"c"},