Skip to content

Commit

Permalink
bugfix: main.go Set flagSet := cmd.PersistentFlags()
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Wan <[email protected]>
  • Loading branch information
HusterWan committed Mar 18, 2018
1 parent f5dbffe commit dce54bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ func main() {

// setupFlags setups flags for command line.
func setupFlags(cmd *cobra.Command) {
flagSet := cmd.Flags()
// Cobra supports Persistent Flags, which, if defined here,
// will be global for your application.
flagSet := cmd.PersistentFlags()

// Cobra also supports local flags, which will only run
// when this action is called directly.
// flagSet := cmd.Flags()

flagSet.StringVar(&cfg.HomeDir, "home-dir", "/var/lib/pouch", "Specify root dir of pouchd")
flagSet.StringArrayVarP(&cfg.Listen, "listen", "l", []string{"unix:///var/run/pouchd.sock"}, "Specify listening addresses of Pouchd")
Expand Down

0 comments on commit dce54bd

Please sign in to comment.