Skip to content

Commit 77f2113

Browse files
authored
Use flags.DumpAll to dump flags (#624)
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent cb54d8c commit 77f2113

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

root.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,29 @@ package cmds
22

33
import (
44
"flag"
5-
"log"
65
"os"
76

7+
"github.com/appscode/go/flags"
88
"github.com/appscode/go/log/golog"
99
v "github.com/appscode/go/version"
1010
"github.com/appscode/kutil/tools/cli"
1111
api "github.com/appscode/stash/apis/stash/v1alpha1"
1212
"github.com/appscode/stash/client/clientset/versioned/scheme"
1313
"github.com/appscode/stash/pkg/util"
1414
"github.com/spf13/cobra"
15-
"github.com/spf13/pflag"
1615
genericapiserver "k8s.io/apiserver/pkg/server"
1716
clientsetscheme "k8s.io/client-go/kubernetes/scheme"
1817
"k8s.io/kubernetes/pkg/api/legacyscheme"
1918
)
2019

21-
const (
22-
gaTrackingCode = "UA-62096468-20"
23-
)
24-
2520
func NewRootCmd() *cobra.Command {
2621
var rootCmd = &cobra.Command{
2722
Use: "stash",
2823
Short: `Stash by AppsCode - Backup your Kubernetes Volumes`,
2924
Long: `Stash is a Kubernetes operator for restic. For more information, visit here: https://appscode.com/products/stash`,
3025
DisableAutoGenTag: true,
3126
PersistentPreRun: func(c *cobra.Command, args []string) {
32-
c.Flags().VisitAll(func(flag *pflag.Flag) {
33-
log.Printf("FLAG: --%s=%q", flag.Name, flag.Value)
34-
})
27+
flags.DumpAll(c.Flags())
3528
cli.SendAnalytics(c, v.Version.Version)
3629

3730
scheme.AddToScheme(clientsetscheme.Scheme)

0 commit comments

Comments
 (0)