Replace flag text with const (#1391)
This commit is contained in:
@@ -30,7 +30,7 @@ func Commands() *cobra.Command {
|
||||
RunE: wrapper.Wrapper(Dump),
|
||||
}
|
||||
wrapper.SetFlags(dumpCmd, flag.FlagSet{
|
||||
Optional: []flag.Flag{flag.SupportNoZipFlag, flag.SupportOutputFlag},
|
||||
Optional: []flag.Flag{flag.SupportNoZip, flag.SupportOutput},
|
||||
})
|
||||
|
||||
command := &cobra.Command{
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
"github.com/fission/fission/pkg/controller/client"
|
||||
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||
"github.com/fission/fission/pkg/fission-cli/cmd/support/resources"
|
||||
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||
"github.com/fission/fission/pkg/fission-cli/util"
|
||||
"github.com/fission/fission/pkg/utils"
|
||||
)
|
||||
@@ -41,22 +42,22 @@ type DumpSubCommand struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
func Dump(flags cli.Input) error {
|
||||
c, err := util.GetServer(flags)
|
||||
func Dump(input cli.Input) error {
|
||||
c, err := util.GetServer(input)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
opts := &DumpSubCommand{
|
||||
client: c,
|
||||
}
|
||||
return opts.do(flags)
|
||||
return opts.do(input)
|
||||
}
|
||||
|
||||
func (opts *DumpSubCommand) do(flags cli.Input) error {
|
||||
func (opts *DumpSubCommand) do(input cli.Input) error {
|
||||
fmt.Println("Start dumping process...")
|
||||
|
||||
nozip := flags.Bool("nozip")
|
||||
outputDir := flags.String("output")
|
||||
nozip := input.Bool(flagkey.SupportNoZip)
|
||||
outputDir := input.String(flagkey.SupportOutput)
|
||||
|
||||
// check whether the dump directory exists.
|
||||
_, err := os.Stat(outputDir)
|
||||
|
||||
Reference in New Issue
Block a user